From 667b6ca51fcb3beb345163cd9488c825d81dba1c Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sat, 5 Jan 2013 17:55:07 -0500 Subject: [PATCH] Fixed issue with security function check_abs_path() being too strict for Windows - refs #5670 --- main/inc/lib/security.lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/inc/lib/security.lib.php b/main/inc/lib/security.lib.php index 33438e7f1f..c9a49eff7a 100644 --- a/main/inc/lib/security.lib.php +++ b/main/inc/lib/security.lib.php @@ -54,6 +54,13 @@ class Security { if ($found === 0) { return true; } else { + // Code specific to Windows and case-insensitive behaviour + if (api_is_windows_os()) { + $found = stripos($true_path.'/', $checker_path); + if ($found === 0) { + return true; + } + } // Code specific to courses directory stored on other disk. $checker_path = str_replace(api_get_path(SYS_COURSE_PATH), $_configuration['symbolic_course_folder_abs'], $checker_path); $found = strpos($true_path.'/', $checker_path);