Disable globbing in PHP exec()

Posted by wxs on Stack Overflow See other posts from Stack Overflow or by wxs
Published on 2010-06-15T05:33:52Z Indexed on 2010/06/15 5:52 UTC
Read the original article Hit count: 159

Filed under:

I have a PHP script which calls another script in order to add IP addresses to a whitelist. I sometimes want to whitelist all addresses, in which case I have it call

exec("otherscript *.*.*.*", output, retval);

This worked fine, adding the string "*.*.*.*" to the whitelist until I happened to have another file in the directory of the php script that matched that pattern ("foo.1.tar.gz"), at which point the wildcards were expanded, and I ended up with the filename in my whitelist. Is there some way to disable globbing in php's exec? It isn't mentioned in the PHP docs as far as I can tell.

© Stack Overflow or respective owner

Related posts about php