From 7c20bb3cae65a41803cb883f03997452a3f5d5b0 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 7 Oct 2022 11:24:08 +1100 Subject: [PATCH] Fix issue with urls that are double url encoded --- CRM/Mosaico/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Mosaico/Utils.php b/CRM/Mosaico/Utils.php index 97b86c65f..351db285e 100644 --- a/CRM/Mosaico/Utils.php +++ b/CRM/Mosaico/Utils.php @@ -387,7 +387,7 @@ public static function processImg() { case 'cover': $func = ($method === 'resize') ? 'createResizedImage' : 'createCoveredImage'; - $path_parts = pathinfo(CRM_Utils_String::purifyHTML(CRM_Utils_Request::retrieveValue('src', 'String', NULL, TRUE, 'GET'))); + $path_parts = pathinfo(CRM_Utils_String::purifyHTML(urldecode(str_replace('%25', '%', CRM_Utils_Request::retrieveValue('src', 'String', NULL, TRUE, 'GET'))))); $src_file = $config['BASE_DIR'] . $config['UPLOADS_DIR'] . $path_parts["basename"]; $cache_file = $config['BASE_DIR'] . $config['STATIC_DIR'] . $path_parts["basename"]; // $cache_file = $config['BASE_DIR'] . $config['STATIC_DIR'] . $method . '-' . $width . "x" . $height . '-' . $path_parts["basename"];