|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-29 05:28 UTC] veins at kheos dot net
[2002-06-02 14:01 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 17:00:02 2025 UTC |
When safe_mode is set to On, it is impossible to pass a variable that contains a string with a space in it as an argument to any system() like function. The following script shows the problem: <? $somevar = "this is a test"; exec("echo.sh $somevar", $return); echo $return[0]; ?> echo.sh being a simple shell script that echoes back anything that we feed it. The following PHP script will display 'this' instead of 'this is a test'. I tried backslashing every chars of the variable by writing a simple function but spaces seems not to be correctly passed to the shell script. The same script executed when safe_mode is set to off works perfectly... Veins - Veins@Kheos.Net