- check for defined variable in makeCorrectFile as an undefined may return unwanted values

This commit is contained in:
Michael Kaufmann (d00p)
2010-06-28 08:23:11 +00:00
parent cf2104e989
commit cc5c30cc69

View File

@@ -29,6 +29,15 @@
function makeCorrectFile($filename) 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) != '/') if(substr($filename, 0, 1) != '/')
{ {
$filename = '/' . $filename; $filename = '/' . $filename;