Disable globbing in PHP exec() -


I have a PHP script, which calls the second script to add an IP address for a whitelist. I sometimes want to whitelist all the addresses, in which case I have called it

  exec ("otherscript *. *. *. *", Output, retal);  

This works fine, until the string "*. *. *. *" Is added to the whitelist, as long as I did not have another file in the directory of that php script, That pattern ("Foo.1.tar.gz"), was expanded to the wildcards at that point, and is there any way to disable globing in PHP exec in my white list that ends with the filename? This is not mentioned in the PHP docs, as far as I can tell.

This will ensure that your strings are safe to use as shell logic, perhaps the manual of globbig Is not mentioned in it because it is dependent on shell, and it is also different between different shells.

  $ address = escapeshellarg ('*. *. *. *'); Exec ("$ script $ address", $ output, $ $);  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -