Home » HTTP » HTTP_Download » Bug #8039
Using HTTP_Download with Send a hidden file and streams
Details
| Submitted | 2006-06-27 01:18 UTC |
|---|---|
| From | ybachrach at wcg dot net dot au |
| Status | Bogus |
| Package | HTTP_Download |
| PHP Version | 5.1.4 |
| OS | Linux |
| 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.