Allowing symlinks

This commit is contained in:
John Campbell
2017-02-22 12:55:28 -05:00
parent 8177434bab
commit 60baa1c507

View File

@@ -36,9 +36,10 @@ if($PASSWORD) {
setlocale(LC_ALL,'en_US.UTF-8');
$tmp = realpath($_REQUEST['file']);
$tmp_dir = dirname($_SERVER['SCRIPT_FILENAME']);
if($tmp === false)
err(404,'File or Directory Not Found');
if(substr($tmp, 0,strlen(__DIR__)) !== __DIR__)
if(substr($tmp, 0,strlen($tmp_dir)) !== $tmp_dir)
err(403,"Forbidden");
if(!$_COOKIE['_sfm_xsrf'])