Issue with PHP 5.1.2, XML_Parser , File_XSPF
| From: | Dan Rossi | Date: | Sun, 05 Feb 2006 13:27:54 +0000 |
| Subject: | Issue with PHP 5.1.2, XML_Parser , File_XSPF | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22794@lists.php.net to get a copy of this message | ||
Hi there I think I have found a possible bug with file_exists , but id like to check first. From the feature request File_XSPF now contains a method for passing through xspf playlists as strings. However it uses the setInput method in XML_Parser. However within the setInput method $fp as a string , so not a file to be parsed is returning true at the last point file_exists($fp), so is not making it to the last control statement to return a string to $this->fp. This was pretty much breaking File_XSPF for me so ive asked to change it to setInputString ??. So im asking where is the bug, in PHP 5.1.2 with file_exists returning true for data being passed to it when in fact its not a file at all, or a bug in XML_Parser or both ? Let me know, so i can send the reports thanks.
function setInput($fp)
{
if (is_resource($fp)) {
$this->fp = $fp;
return true;
}
// see if it's an absolute URL (has a scheme at
the beginning)
elseif (eregi('^[a-z]+://', substr($fp, 0, 10)))
{
return $this->setInputFile($fp);
}
// see if it's a local file
elseif (file_exists($fp)) {
die("yes");
return $this->setInputFile($fp);
}
// it must be a string
else {
die("yes");
$this->fp = $fp;
return true;
}