php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42125 fgetss reads an extra char from file created using file_put_content()
Submitted: 2007-07-27 11:54 UTC Modified: 2008-02-17 01:00 UTC
From: kraghuba at in dot ibm dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 6CVS-2007-07-27 (snap) OS: Windows XP
Private report: No CVE-ID: None
 [2007-07-27 11:54 UTC] kraghuba at in dot ibm dot com
Description:
------------
fgetss() read an extra char from a file which is created using file_put_content() function.

This problem is noticed only on php6 with unicode ON.

Reproduce code:
---------------
<?php
$data = <<<EOT
<test>Testing fgetss() functions</test>
test
EOT;

$filename = "test.txt";
file_put_contents($filename, $data);
$fp = fopen($filename, "r");
var_dump( fgetss($fp) );
fclose($fp);
?>

Expected result:
----------------
int(44)
string(27) "Testing fgetss() functions
"

Actual result:
--------------
string(28) "Testing fgetss() functions
"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-09 19:04 UTC] felipe@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php6.0-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php6.0-win32-latest.zip


 [2008-02-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC