ewww_image_optimizer_escapeshellarg windows "bug"
-
Hi,
ewww_image_optimizer_escapeshellarg doesn’t work on Windows (in EWWW IO 1.9.0): It uses single quotes instead of (the required) double quotes. This results in no optimizations on Windows machines (the tool calls work, but they fail to find the images). As a quick fix I changed it to the following, and everythings works fine:
function ewww_image_optimizer_escapeshellarg( $arg ) { global $ewww_debug; if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) { $safe_arg = '"' . addcslashes( $arg, '\\"' ) . '"'; } else { $safe_arg = "'" . str_replace("'", "'\"'\"'", $arg) . "'"; } return $safe_arg; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘ewww_image_optimizer_escapeshellarg windows "bug"’ is closed to new replies.