From ad2d96ba645a37891c34336fc1acf8502f3cf8c3 Mon Sep 17 00:00:00 2001 From: spalmstr Date: Thu, 23 Feb 2017 14:34:03 +0000 Subject: [PATCH] CRM-19453 --- CRM/Utils/System/Joomla.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 2758d11758..8162ac8a61 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -712,8 +712,20 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { '', $config->userFrameworkBaseURL ); + // CRM-19453 revisited. Under Windows, the pattern wasn't recognised. + // This is the original pattern, but it doesn't work under Windows. + // By setting the pattern to the one used before the change first and only + // changing it means that the change code only affects Windows users. + $pattern = '|/media/civicrm/.*$|'; + if (DIRECTORY_SEPARATOR == '\\') { + // This regular expression will handle Windows as well as Linux + // and any combination of forward and back slashes in directory + // separators. We only apply it if the directory separator is the one + // used by Windows. + $pattern = '|[\\\\/]media[\\\\/]civicrm[\\\\/].*$|'; + } $siteRoot = preg_replace( - '|/media/civicrm/.*$|', + $pattern, '', $config->imageUploadDir ); -- 2.25.1