From ec306048e5590745477aa1b271089843c9298e86 Mon Sep 17 00:00:00 2001 From: LarsDW223 Date: Fri, 13 May 2016 22:00:54 +0200 Subject: [PATCH] Fixed _realpath() for UNC pathes like '\\examplepath\mypath' (will become '//examplepath/mypath'). See #1. Here is a comparison between the output of the old and new version of _realpath(): Input: '/a/b/c/' Output old: '/a/b/c/' Output new: '/a/b/c' Input: '//a/b/c' Output old: '/a/b/c' Output new: '//a/b/c' Input: 'a//b' Output old: 'a/b' Output new: 'a//b' --- syntax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax.php b/syntax.php index 5752b4d..9fe5287 100644 --- a/syntax.php +++ b/syntax.php @@ -886,8 +886,8 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { $path=explode('/', $path); $output=array(); for ($i=0; $i 0) || '.' == $path[$i]) continue; - if ('..' == $path[$i] && $i > 0 && '..' != $output[sizeof($output) - 1]) { + if ('.' == $path[$i]) continue; + if ('..' == $path[$i] && '..' != $output[sizeof($output) - 1]) { array_pop($output); continue; }