Bug #15157: exec()/system() doesn't work with parameters in quotation-marks in system-call
| From: | o dot kuhl at gmx dot de | Date: | Tue, 22 Jan 2002 08:12:56 +0000 |
| Subject: | Bug #15157: exec()/system() doesn't work with parameters in quotation-marks in system-call | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77732@lists.php.net to get a copy of this message | ||
From: o.kuhl@gmx.de
Operating system: Linux (Debian) / Solaris 8
PHP version: 4.1.0
PHP Bug Type: Program Execution
Bug description: exec()/system() doesn't work with parameters in quotation-marks in
system-call
The exec/system-Functions don't work with calls like this:
whois -h whois.denic.de "Penelope Cruz"
The problem is the string "Penelope Cruz", which has to be one parameter
for the whois-function. Without quotation marks, the string is used as two
parameters - even when they're connected with "\ " -> ("Penelope\
Cruz").
And with quotation marks, PHP executes the command with "Penelope Cruz" as
one string, BUT WITH the quotation marks included.
I tried several other ways (with system(), too), but none of them worked:
exec("whois -h whois.denic.de Penelope\ Cruz");
exec("whois -h whois.denic.de \"Penelope\ Cruz\"");
exec("whois -h whois.denic.de \"Penelope Cruz\"");
exec("whois -h whois.denic.de 'Penelope\ Cruz'");
exec("whois -h whois.denic.de ".'"'."Penelope
Cruz".'"'.");
...
My config:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--with-zlib=/usr'
'--with-curl=/usr/local' '--with-mysql=/usr/local/mysql'
'--with-ldap=/usr/local' '--with-openssl' '--enable-ftp'
The problem was the same with Linux (Debian Potato) and Solaris8
Greets,
Oliver.
--
Edit bug report at: http://bugs.php.net/?id=15157&edit=1