cvs: php4 /pear/PEAR Common.php

From: Date: Sat, 22 Dec 2001 04:42:12 +0000
Subject: cvs: php4 /pear/PEAR Common.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1655@lists.php.net to get a copy of this message
ssb Fri Dec 21 23:42:12 2001 EDT Modified files: /php4/pear/PEAR Common.php Log: * add "pedantic" mode in infoFromTgzFile and skip some checks if not pedantic Index: php4/pear/PEAR/Common.php diff -u php4/pear/PEAR/Common.php:1.26 php4/pear/PEAR/Common.php:1.27 --- php4/pear/PEAR/Common.php:1.26 Mon Dec 17 16:10:11 2001 +++ php4/pear/PEAR/Common.php Fri Dec 21 23:42:12 2001 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.26 2001/12/17 21:10:11 cox Exp $ +// $Id: Common.php,v 1.27 2001/12/22 04:42:12 ssb Exp $ require_once 'PEAR.php'; require_once 'Archive/Tar.php'; @@ -388,14 +388,17 @@ * Returns info from a tgz pear package * (experimental) */ - function infoFromTgzFile($file) + function infoFromTgzFile($file, $pedantic = true) { - $file = basename($file); // XXX Fixme: Only allows file in the current dir + if ($pedantic) { + // XXX Fixme: Only allows file in the current dir + $file = basename($file); + } if (!@is_file($file)) { return $this->raiseError('no tar file supplied'); } // Assume the decompressed dir name - if (($pos = strrpos($file, '.')) === false) { + if ($pedantic && ($pos = strrpos($file, '.')) === false) { return $this->raiseError('file doesn\'t follow the package name convention'); } $pkgdir = substr($file, 0, $pos);

« previous php.pear.cvs (#1655) next »