PHP 4.0 Bug #8071: quotes being added with readfile()
| From: | phil at cmc dot ca | Date: | Fri, 01 Dec 2000 21:34:52 +0000 |
| Subject: | PHP 4.0 Bug #8071: quotes being added with readfile() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39807@lists.php.net to get a copy of this message | ||
From: phil@cmc.ca
Operating system: Solaris 8
PHP version: 4.0.3pl1
PHP Bug Type: Filesystem function related
Bug description: quotes being added with readfile()
PHP seems to be adding quotes after "=" (equal signs) when putting a binary file through
to the browser via readfile().
A snippet of the code doing this:
// Send the file. Note that PHP automatically sends the
// private cache directives as this is part of a session.
$size = filesize("$xferdir->path/$dload");
header("Content-Type: $type");
header("Content-Length: $size");
// detect any gzip'd files and set the content encoding
// header accordingly
if (preg_match('/\.gz$/', $file))
header ("Content-Encoding: gzip");
// disable magic quotes so they don't interfere with the
// file being sent.
// if (get_magic_quotes_runtime())
set_magic_quotes_runtime(0);
// dump the file to the browser
if (readfile("$xferdir->path/$dload") == $size) {
// if the file is fully downloaded
// add a line to the sslxfer log
log_xfer("$xferdir->path/$dload", "down");
}
The script is called as "dload.php/<filename>" and then sends the given file to the
user. I'll check with our legal dept (blech) on Monday and see if I can make the original and
modified files available.
--
Edit Bug report at: http://bugs.php.net/?id=8071&edit=1