From 30f6a886d873c175d29c0f84d5c604c63acb31b3 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 Dec 2009 12:56:03 +0100 Subject: [PATCH] allow direct=2 to treat pattern as relative to 1st path --- syntax.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/syntax.php b/syntax.php index f5455c4..e1b2745 100644 --- a/syntax.php +++ b/syntax.php @@ -394,6 +394,8 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { global $conf; global $ID; + $allowed_absolute_paths = split(',', $this->getConf('allowed_absolute_paths')); + $result = array( 'files' => array(), 'basedir' => false, @@ -408,6 +410,9 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { } // replace : with / and prepend mediadir $pattern = $this->mediadir . str_replace(':', '/', $pattern); + } elseif($params['direct'] == 2){ + // treat path as relative to first configured path + $pattern = $allowed_absolute_paths[0].'/'.$pattern; } else { // if path is not absolute, precede it with DOKU_INC if (!$this->_path_is_absolute($pattern)) { @@ -423,7 +428,6 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { } // match pattern aginst allowed paths - $allowed_absolute_paths = split(',', $this->getConf('allowed_absolute_paths')); $web_paths = split(',', $this->getConf('web_paths')); $basedir = false; $webdir = false;