From cc5c30cc690d5ca8bf468aa57ab9b225075af004 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 28 Jun 2010 08:23:11 +0000 Subject: [PATCH] - check for defined variable in makeCorrectFile as an undefined may return unwanted values --- lib/functions/filedir/function.makeCorrectFile.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/functions/filedir/function.makeCorrectFile.php b/lib/functions/filedir/function.makeCorrectFile.php index 752439aa..2d4d9c45 100644 --- a/lib/functions/filedir/function.makeCorrectFile.php +++ b/lib/functions/filedir/function.makeCorrectFile.php @@ -29,6 +29,15 @@ function makeCorrectFile($filename) { + if (!isset($filename) + || trim($filename) == '' + ) { + $error = 'Given filename for function '.__FUNCTION__.' is empty.'."\n"; + $error.= 'This is very dangerous and should not happen.'."\n"; + $error.= 'Please inform the Froxlor team about this issue so they can fix it.'; + die($error); + } + if(substr($filename, 0, 1) != '/') { $filename = '/' . $filename;