diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-02-07 14:43:51 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-02-07 14:43:51 +0100 |
commit | 517c9f9a8dba8e83eaa37a7660f434102e967a77 (patch) | |
tree | 0cbde4da4a40cabd1d4e44ca034176c74006bd4e /program/lib/Roundcube/rcube_utils.php | |
parent | e8dd47fb94ae967a78e5c687fb72d1096d19330b (diff) |
Fix directories check in Installer on Windows (#1489576)
Added rcube_utils::is_absolute_path() method
Diffstat (limited to 'program/lib/Roundcube/rcube_utils.php')
-rw-r--r-- | 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 c48cd80e8..46d53ac91 100644 --- a/program/lib/Roundcube/rcube_utils.php +++ b/program/lib/Roundcube/rcube_utils.php @@ -1045,4 +1045,16 @@ class rcube_utils 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; + } + } } |