From: Stig Bakken Date: Sat, 22 Dec 2001 04:42:12 +0000 (+0000) Subject: * add "pedantic" mode in infoFromTgzFile and skip some checks if not X-Git-Tag: PRE_ISSET_PATCH~452 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c3b983a352abdb5ce8382019b85982bb4dfd894;p=php * add "pedantic" mode in infoFromTgzFile and skip some checks if not pedantic --- diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index a717acd607..e25fcc3511 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -388,14 +388,17 @@ class PEAR_Common extends PEAR * 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);