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

Merge pull request #1456 from splitbrain/runawayprotect

do not accept empty or root $base in search. fixes #1452
parents 1e623524 e0b6aade
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,11 @@ function search(&$data,$base,$func,$opts,$dir='',$lvl=1,$sort='natural'){
$files = array();
$filepaths = array();
// safeguard against runaways #1452
if($base == '' || $base == '/') {
throw new RuntimeException('No valid $base passed to search() - possible misconfiguration or bug');
}
//read in directories and files
$dh = @opendir($base.'/'.$dir);
if(!$dh) return;
......
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