From b35868f50a7238955a6c6d82625bd5ecb91607c6 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 27 Aug 2014 15:13:17 -0700 Subject: [PATCH] CRM-15163 - CRM_Utils_Check_Security - Windows support On Windows-PHP setups, paths may have a mix of back-slashes and forward-slashes. For this security check, we'll normalize to forward-slashses to simplify the path manipulation. --- CRM/Utils/Check/Security.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Check/Security.php b/CRM/Utils/Check/Security.php index da8e706f58..a6de3924a5 100644 --- a/CRM/Utils/Check/Security.php +++ b/CRM/Utils/Check/Security.php @@ -88,7 +88,7 @@ class CRM_Utils_Check_Security { $config = CRM_Core_Config::singleton(); $log = CRM_Core_Error::createDebugLogger(); - $log_filename = $log->_filename; + $log_filename = str_replace('\\', '/', $log->_filename); $filePathMarker = $this->getFilePathMarker(); @@ -282,7 +282,7 @@ class CRM_Utils_Check_Security { $config = CRM_Core_Config::singleton(); list ($heuristicBaseUrl, $ignore) = explode($filePathMarker, $config->imageUploadURL); - list ($ignore, $heuristicSuffix) = explode($filePathMarker, $targetDir); + list ($ignore, $heuristicSuffix) = explode($filePathMarker, str_replace('\\', '/', $targetDir)); return $heuristicBaseUrl . $filePathMarker . $heuristicSuffix; } } -- 2.25.1