From: kraghuba at in dot ibm dot com Operating system: Windows XP PHP version: 6CVS-2007-07-27 (snap) PHP Bug Type: Filesystem function related Bug description: fgetss reads an extra char from file created using file_put_content()
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 " -- Edit bug report at http://bugs.php.net/?id=42125&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42125&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42125&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42125&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42125&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42125&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42125&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42125&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42125&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42125&r=support Expected behavior: http://bugs.php.net/fix.php?id=42125&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42125&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42125&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42125&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42125&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42125&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42125&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42125&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42125&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42125&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42125&r=mysqlcfg
