diff options
Diffstat (limited to 'inc/farm.php')
-rw-r--r-- | inc/farm.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/inc/farm.php b/inc/farm.php index 8434e3067..51b0c0f78 100644 --- a/inc/farm.php +++ b/inc/farm.php @@ -46,6 +46,9 @@ function conf_path($farm) { if(isset($_REQUEST['animal']) || ('cli' == php_sapi_name() && isset($_SERVER['animal']))) { $mode = isset($_REQUEST['animal']) ? 'htaccess' : 'cli'; $animal = $mode == 'htaccess' ? $_REQUEST['animal'] : $_SERVER['animal']; + // check that $animal specifies a subdirectory of $farm + if (strpos(fullpath($farm.'/'.$animal), fullpath($farm).'/') !== 0) + nice_die('Sorry! Invalid Wiki name!'); if(!is_dir($farm.'/'.$animal)) nice_die("Sorry! This Wiki doesn't exist!"); if(!defined('DOKU_FARM')) define('DOKU_FARM', $mode); |