CLI Injection

If you do ever need to use the command line (aka shell) to run another program, typically though:

The command you want to execute should use escapeshellcmd, and any arguments should use escapeshellarg.

For example:

system('ls ' . escapeshellarg($dir));