Also allow open_file.php to be called with a path paramater instead of only with seperate dir/file
This commit is contained in:
parent
56ec730337
commit
e0f6ad1c9c
|
@ -24,12 +24,16 @@
|
||||||
|
|
||||||
require_once('../inc/lib_base.php');
|
require_once('../inc/lib_base.php');
|
||||||
|
|
||||||
$file=$_GET['file'];
|
if(isset($_GET['path'])){
|
||||||
$dir=(isset($_GET['dir']))?$_GET['dir']:'';
|
$filename=$_GET['path'];
|
||||||
if(strstr($file,'..') or strstr($dir,'..')){
|
}else{
|
||||||
die();
|
$file=$_GET['file'];
|
||||||
|
$dir=(isset($_GET['dir']))?$_GET['dir']:'';
|
||||||
|
$filename=$dir.'/'.$file;
|
||||||
|
}
|
||||||
|
if(strstr($filename,'..')){
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
$filename=$dir.'/'.$file;
|
|
||||||
$filename=stripslashes($filename);
|
$filename=stripslashes($filename);
|
||||||
$ftype=OC_FILESYSTEM::getMimeType($filename);
|
$ftype=OC_FILESYSTEM::getMimeType($filename);
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
Loading…
Reference in New Issue