From: Tim Otten Date: Wed, 27 Aug 2014 22:13:17 +0000 (-0700) Subject: CRM-15163 - CRM_Utils_Check_Security - Windows support X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b35868f50a7238955a6c6d82625bd5ecb91607c6;p=civicrm-core.git 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. --- 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; } }