Bug #11767: Bad escape sequence

From: Date: Thu, 28 Jun 2001 06:27:48 +0000
Subject: Bug #11767: Bad escape sequence
Groups: php.dev 
Request: Send a blank email to php-dev+get-58291@lists.php.net to get a copy of this message
From: veins@kheos.net Operating system: Unix PHP version: 4.0.6 PHP Bug Type: Unknown/Other Function Bug description: Bad escape sequence 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 -- Edit Bug report at: http://bugs.php.net/?id=11767&edit=1

« previous php.dev (#58291) next »