|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-07-27 11:54 UTC] kraghuba at in dot ibm dot com
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:
$data = <<<EOT
<test>Testing fgetss() functions</test>

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

Expected result:
string(27) "Testing fgetss() functions

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-09 19:04 UTC]
Please try using this CVS snapshot:
For Windows:

 [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-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 04:01:23 2021 UTC