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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
26 + 31 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 21:01:28 2024 UTC