|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-22 16:51 UTC] Arne dot Heizmann at csr dot com
Description:
------------
The exec() call is supposed to return the output of the system call into the second parameter.
However, it modifies this output. It behaves as if rtrim() is called on each line. This causes data loss because rtrim() is not reversible.
Reproduce code:
---------------
<?
header ('Content-type: text/plain');
file_put_contents ('temp', " "); // also reproducible with "\t"
exec ("type temp", $ops, $result);
echo var_export ($ops, true);
?>
Expected result:
----------------
array (
0 => ' ',
)
Actual result:
--------------
array (
0 => '',
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 12:00:01 2025 UTC |
Even easier to reproduce: <?php var_dump(exec("echo ' '")); ?>