ID:               30404
 User updated by:  php-bug at angehrn dot com
 Reported By:      php-bug at angehrn dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      4.3.9
 New Comment:

with a small shell script, you can reproduce the wrong behaviour:

Reproduce code:
---------------

test.php:
----
<?php
exec('./test_script "test 1.jpg"',$array1,$return1);
exec('./test_script test\ 1.jpg', $array2,$return2);

echo '<pre>';
echo $return1;
print_r($array1);

echo '<br /><br />';
echo $return2;
print_r($array2);

echo '</pre>';
?>
----

test_script:
----
#!/bin/sh
echo $1
echo $2
exit 0
----


Expected result:
----------------
0Array
(
    [0] => test 1.jpg
    [1] => 
)


0Array
(
    [0] => test 1.jpg
    [1] => 
)



Actual result:
--------------

0Array
(
    [0] => test 1.jpg
    [1] => 
)


0Array
(
    [0] => test\
    [1] => 1.jpg
)


Previous Comments:
------------------------------------------------------------------------

[2004-10-23 12:44:49] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


How exactly does it fail?

------------------------------------------------------------------------

[2004-10-11 22:59:17] php-bug at angehrn dot com

Description:
------------
if safe_mode is on, i cannot use a command with backslash escaped
commands in exec()

Reproduce code:
---------------
safe_mode off

exec('convert logo: "test 1.jpg"'); - works
exec('convert logo: test\ 1.jpg'); - works

safe_mode on

exec('convert logo: "test 1.jpg"'); - works
exec('convert logo: test\ 1.jpg'); - fails

Expected result:
----------------
it should work like the command with safemode off

Actual result:
--------------
it fails...


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30404&edit=1

Reply via email to