fix #35
This commit is contained in:
parent
6f6b9e1ca0
commit
071c9dddd2
1 changed files with 6 additions and 1 deletions
|
@ -152,7 +152,12 @@ $requestedDir = '';
|
||||||
if (!empty($_GET['dir'])) $requestedDir = $_GET['dir'];
|
if (!empty($_GET['dir'])) $requestedDir = $_GET['dir'];
|
||||||
$thumbdir = rtrim('photos/'.$requestedDir,'/');
|
$thumbdir = rtrim('photos/'.$requestedDir,'/');
|
||||||
|
|
||||||
$thumbdir = str_replace('/..', '', $thumbdir); // Prevent directory traversal attacks.
|
//$thumbdir = str_replace('/..', '', $thumbdir); // Prevent directory traversal attacks.
|
||||||
|
if(strstr($thumbdir, '..') !== FALSE) {
|
||||||
|
$requestedDir = '';
|
||||||
|
$thumbdir = rtrim('photos/','/');
|
||||||
|
}
|
||||||
|
|
||||||
$currentdir = GALLERY_ROOT . $thumbdir;
|
$currentdir = GALLERY_ROOT . $thumbdir;
|
||||||
|
|
||||||
//-----------------------
|
//-----------------------
|
||||||
|
|
Loading…
Reference in a new issue