Skip to content
Snippets Groups Projects
Commit d867cca3 authored by Michael Hamann's avatar Michael Hamann
Browse files

Check that the animal is actually inside the farm

This makes sure that the animal that is specified in the URL is actually
a subdirectory inside the farm and not somewhere else in the system.
This allows that the animals are organized in different subdirectories
for more complicated farm setups.
parent 0990161c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment