php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8071 quotes being added with readfile()
Submitted: 2000-12-01 16:34 UTC Modified: 2001-01-30 04:24 UTC
From: phil at cmc dot ca Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: Solaris 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phil at cmc dot ca
New email:
PHP Version: OS:

 

 [2000-12-01 16:34 UTC] phil at cmc dot ca
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-11 05:41 UTC] stas@php.net
Do you use trans-sid feature?
 [2000-12-11 10:35 UTC] stas@php.net
The user is using trans-sid feature.

Could you please give example of any file where it happens?
 [2001-01-30 04:24 UTC] sniper@php.net
This should be fixed in PHP 4.0.4pl1 (or at least in the
latest CVS, try a snapshot from http://snaps.php.net/ )

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 21:01:34 2025 UTC