cvs: pear-core /PEAR PackageFile.php

From: Date: Sun, 20 Feb 2005 21:35:06 +0000
Subject: cvs: pear-core /PEAR PackageFile.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-29569@lists.php.net to get a copy of this message
cellog Sun Feb 20 16:35:06 2005 EDT Modified files: /pear-core/PEAR PackageFile.php Log: fix bug #3533: php bug 31347 trips up file_exists() check in infoFromAny http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile.php?r1=1.14&r2=1.15&ty=u Index: pear-core/PEAR/PackageFile.php diff -u pear-core/PEAR/PackageFile.php:1.14 pear-core/PEAR/PackageFile.php:1.15 --- pear-core/PEAR/PackageFile.php:1.14 Mon Dec 27 01:41:52 2004 +++ pear-core/PEAR/PackageFile.php Sun Feb 20 16:35:04 2005 @@ -16,7 +16,7 @@ // | Authors: Gregory Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: PackageFile.php,v 1.14 2004/12/27 06:41:52 cellog Exp $ +// $Id: PackageFile.php,v 1.15 2005/02/20 21:35:04 cellog Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Validate.php'; /** @@ -32,7 +32,7 @@ * Abstraction for the package.xml package description file * * @author Gregory Beaver <cellog@php.net> - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * @stability devel * @package PEAR */ @@ -240,7 +240,7 @@ $tar->popErrorHandling(); } if (!is_array($content)) { - if (!@is_file($file)) { + if (is_string($file) && strlen($file < 255) && !@is_file($file)) { $ret = PEAR::raiseError("could not open file \"$file\""); return $ret; } @@ -296,7 +296,8 @@ */ function &fromPackageFile($descfile, $state, $archive = false) { - if (!@is_file($descfile) || !is_readable($descfile) || + if (is_string($descfile) && strlen($descfile) < 255 && + !@is_file($descfile) || !is_readable($descfile) || (!$fp = @fopen($descfile, 'r'))) { return PEAR::raiseError("Unable to open $descfile"); } @@ -322,7 +323,8 @@ function &fromAnyFile($info, $state) { $fp = false; - if (is_string($info) && (file_exists($info) || ($fp = @fopen($info, 'r')))) { + if (is_string($info) && strlen($info) < 255 && + (file_exists($info) || ($fp = @fopen($info, 'r')))) { if ($fp) { fclose($fp); }

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