Skip to content
Snippets Groups Projects
Commit e0f6ad1c authored by Robin Appelman's avatar Robin Appelman
Browse files

Also allow open_file.php to be called with a path paramater instead of only with seperate dir/file

parent 56ec7303
No related branches found
No related tags found
No related merge requests found
......@@ -24,12 +24,16 @@
require_once('../inc/lib_base.php');
$file=$_GET['file'];
$dir=(isset($_GET['dir']))?$_GET['dir']:'';
if(strstr($file,'..') or strstr($dir,'..')){
die();
if(isset($_GET['path'])){
$filename=$_GET['path'];
}else{
$file=$_GET['file'];
$dir=(isset($_GET['dir']))?$_GET['dir']:'';
$filename=$dir.'/'.$file;
}
if(strstr($filename,'..')){
die();
}
$filename=$dir.'/'.$file;
$filename=stripslashes($filename);
$ftype=OC_FILESYSTEM::getMimeType($filename);
ob_end_clean();
......
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