From 9c3b983a352abdb5ce8382019b85982bb4dfd894 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Sat, 22 Dec 2001 04:42:12 +0000 Subject: [PATCH] * add "pedantic" mode in infoFromTgzFile and skip some checks if not pedantic --- pear/PEAR/Common.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); -- 2.50.1