summaryrefslogtreecommitdiff
path: root/inc/farm.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/farm.php')
-rw-r--r--inc/farm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/farm.php b/inc/farm.php
index 51b0c0f78..37ae24c16 100644
--- a/inc/farm.php
+++ b/inc/farm.php
@@ -46,9 +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!');
+ // check that $animal is a string and specifies a subdirectory of $farm
+ if (!is_string($animal) || strpos(fullpath($farm.'/'.$animal), fullpath($farm).'/') !== 0)
+ nice_die('Sorry! Invalid animal name!');
if(!is_dir($farm.'/'.$animal))
nice_die("Sorry! This Wiki doesn't exist!");
if(!defined('DOKU_FARM')) define('DOKU_FARM', $mode);