php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #297 printing quotation mark read by fgets-function
Submitted: 1998-04-21 22:57 UTC Modified: 1998-05-01 14:31 UTC
From: gihwaja at chollian dot net Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Release Candidate 4 OS: SunOS 5.5.1
Private report: No CVE-ID: None
 [1998-04-21 22:57 UTC] gihwaja at chollian dot net
Let's say that "quotation" file has only five quotation mark.
(that is, """"")
and execute following php-script

<?php
    $fp = fopen("quotation", "r");
    echo fgets($fp, 100);
?>

The result is
    \"\"\"\"\"
of length 10, not 5.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-01 14:31 UTC] jim
This is happening because you have magic_quotes_runtime
on in your configuration file. Either turn that off,
or run stripslashes() on the string before printing it.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 21 23:03:34 2022 UTC