PDA

View Full Version : Checking if file is NFO



Techn9ne1730
11-29-2010, 01:25 AM
EDIT: Disregard!

We have a custom made nfo upload mod installed. There is just one piece of code that is bugged:


if($_FILES['nfo']) {
if(substr(strtolower($nfofile['name']), strlen($nfofile['name']) - strlen(".nfo")) !== ".nfo") {
$Err = "You seem to have put something other than a nfo file into the nfo upload field. (".$nfofile['name'].").";
}
}

When this code is put in, NFO files are requiered. If the code is commented out, NFOs become optional BUt users can upload any type of file regardless if it is an NFO file. Does any one see what could be causing the problem here?