Well, header says it all.
in php, how do I reverse escapeshellarg()?
To be more precise, what is the built-in function (if there is one) that will reverse it.
Most thorough route would be to find out exactly what escapeshellarg() does and do the opposite. In a linux environment, it looks like it's just taking care of single quotes. In a Windows environment, it's doing a bit more. Your reverse function should take that into account as well.
Regarding a built-in function: The short answer is "there isn't one." The long answer is: there isn't one because escaped shell arguments aren't ever intended to get parsed by PHP (why escape them in the first place?) so nobody ever wrote one and submitted it as a patch to PHP. If you're passing arguments into a CLI PHP application, you don't need to unescape things as that was done already by the interpreter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With