From 4d798e23d2f78e1da48f2c0d6638c491222a9cd9 Mon Sep 17 00:00:00 2001 From: LarsDW223 Date: Fri, 13 May 2016 19:00:31 +0200 Subject: [PATCH] Adjusted _path_is_absolute() to also recognize a path like '\\mypath' as absolute under windows. See #1. --- syntax.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/syntax.php b/syntax.php index 6ab827a..aa7db87 100644 --- a/syntax.php +++ b/syntax.php @@ -741,7 +741,7 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { } /** - * Does a (recursive) crawl for finging files based on a given pattern. + * Does a (recursive) crawl for finding files based on a given pattern. * Based on a safe glob reimplementation using fnmatch and opendir. * * @param $pattern the pattern to match to @@ -963,7 +963,10 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { */ function _path_is_absolute($path) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - return ($path[1] == ':'); + if ($path[1] == ':' || ($path[0] == '/' && $path[1] == '/')) { + return true; + } + return false; } else { return ($path[0] == '/'); }