|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-29 11:56 UTC] phpbug dot 40928 at sub dot noloop dot net
[2008-08-02 19:22 UTC] kalle@php.net
[2008-08-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ On win32, the function escapeshellarg() replaces percent characters (%) with spaces. Instead, the function should escape the percent character, perhaps using the ^% construct, so that the percent sign can be safely used as a an argument to an application executed through exec(). Reproduce code: --------------- <? // .... This creates a directory called "Test dir" (without the quotes) // .... which is unexpected. $cmd = 'md'; $arg = 'test%dir'; $fullcmd = $cmd.' '.escapeshellarg($arg); // .... This creates a directory called "Test%dir" (without the quotes) // .... which is the expected result of the above. // $fullcmd = 'md test^%dir'; exec($fullcmd); system("dir /B"); ?> Expected result: ---------------- test%dir Actual result: -------------- test dir