PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Download » Bug #8039

Using HTTP_Download with Send a hidden file and streams

Details

Submitted2006-06-27 01:18 UTC
Fromybachrach at wcg dot net dot au
StatusBogus
PackageHTTP_Download
PHP Version5.1.4
OSLinux
Roadmaps(Not assigned)

Comments

[2006-06-27 01:18 UTC] ybachrach at wcg dot net dot au

Description:
------------
When using the HTTP_Dowload package and trying to send a hidden file but the file is a stream, it throw an error.
I beleive the problem is in the realpath() function that cannot receive this kind of path (var://GLOBALS/stream).

Test script:
---------------
function setFile($file, $send_404 = true)
{
Controller::log($file);
$file = realpath($file);
Controller::log($file);
if (!is_file($file)) {
if ($send_404) {
$this->HTTP->sendStatusCode(404);
}
return PEAR::raiseError(
"File '$file' not found.",
HTTP_DOWNLOAD_E_INVALID_FILE
);
}
$this->setLastModified(filemtime($file));
$this->file = $file;
$this->size = filesize($file);
return true;
}

Expected result:
----------------
No to get an error with giving this path.