DistributedProofreaders / ppwb

Post Processor's Workbench
GNU General Public License v3.0
5 stars 6 forks source link

Don't double-escape shell commands #30

Closed cpeel closed 2 years ago

cpeel commented 2 years ago

Using escapeshellarg() to escape user inputs being passed as args is all that is necessary before running a command. escapeshellcmd() can double encode unmatched double- and single-quotes when used with escapeshellarg().

https://gist.github.com/Zenexer/40d02da5e07f151adeaeeaa11af9ab36 is an interesting read.

Testable at https://www.pgdp.org/~cpeel/ppwb

cpeel commented 2 years ago

TEST and PROD have both been updated with this code.