Skip to content

Commit

Permalink
Smarter escaping of problematic image filename chars
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Apr 23, 2018
1 parent fb48237 commit 47b06e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/modules/additional_images.php
Expand Up @@ -65,7 +65,7 @@
$current_image_match
);

if ($current_image_match || preg_match('/\Q' . $products_image_base . '\E/i', $file) == 1) {
if ($current_image_match || preg_match('/' . preg_quote($products_image_base, '/') . '/i', $file) == 1) {
if ($current_image_match || substr($file, 0, strrpos($file, '.')) != substr($products_image, 0, strrpos($products_image, '.'))) {
if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
// echo 'I AM A MATCH ' . $file . '<br>';
Expand Down

0 comments on commit 47b06e9

Please sign in to comment.