From 517c9f9a8dba8e83eaa37a7660f434102e967a77 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 07 Feb 2014 08:43:51 -0500 Subject: [PATCH] Fix directories check in Installer on Windows (#1489576) Added rcube_utils::is_absolute_path() method --- program/lib/Roundcube/rcube_utils.php | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php index c48cd80..46d53ac 100644 --- a/program/lib/Roundcube/rcube_utils.php +++ b/program/lib/Roundcube/rcube_utils.php @@ -1045,4 +1045,16 @@ return !in_array($str, array('false', '0', 'no', 'off', 'nein', ''), true); } + /** + * OS-dependent absolute path detection + */ + public static function is_absolute_path($path) + { + if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { + return (bool) preg_match('!^[a-z]:[\\\\/]!i', $path); + } + else { + return $path[0] == DIRECTORY_SEPARATOR; + } + } } -- Gitblit v1.9.1