cvs: pear /File_Archive/Archive/Reader Gzip.php

From: Date: Sun, 22 May 2005 21:36:07 +0000
Subject: cvs: pear /File_Archive/Archive/Reader Gzip.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-32014@lists.php.net to get a copy of this message
vincentlascaux Sun May 22 17:36:07 2005 EDT Modified files: /pear/File_Archive/Archive/Reader Gzip.php Log: Bug in the naming of the file contained in the filename I removed the extension, but I forgot to remove the folders (so A/B.gz contained A/B, instead of B) http://cvs.php.net/diff.php/pear/File_Archive/Archive/Reader/Gzip.php?r1=1.13&r2=1.14&ty=u Index: pear/File_Archive/Archive/Reader/Gzip.php diff -u pear/File_Archive/Archive/Reader/Gzip.php:1.13 pear/File_Archive/Archive/Reader/Gzip.php:1.14 --- pear/File_Archive/Archive/Reader/Gzip.php:1.13 Fri May 6 16:19:49 2005 +++ pear/File_Archive/Archive/Reader/Gzip.php Sun May 22 17:36:06 2005 @@ -25,7 +25,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Gzip.php,v 1.13 2005/05/06 20:19:49 vincentlascaux Exp $ + * @version CVS: $Id: Gzip.php,v 1.14 2005/05/22 21:36:06 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -102,12 +102,16 @@ function getFilename() { $name = $this->source->getFilename(); - $pos = strrpos($name, "."); - if ($pos === false || $pos === 0) { - return $name; - } else { - return substr($name, 0, $pos); + $slashPos = strrpos($name, '/'); + if ($slashPos !== false) { + $name = substr($name, $slashPos+1); + } + $dotPos = strrpos($name, '.'); + if ($dotPos !== false && $dotPos > 0) { + $name = substr($name, 0, $dotPos); } + + return $name; } /** * @see File_Archive_Reader::getData()

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