Community Support for OpenDocMan (Deprecated)

Full Version: Bug - allowedFileTypes during Add operation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The add operation does not seem to be checking for allowed filetypes, but check-in does.
This is the fix for this issue:

Replace the foreach and the if($allowedFile) sections with the code below:

Code:
// check file type
    foreach($GLOBALS['allowedFileTypes'] as $thistype)
    {
        if ($_FILES['file']['type'] == $thistype)
        {
            $allowedFile = 1;
            break;
        }
        else
        {
            $allowedFile = 0;
        }
    }
    // illegal file type!
    if ($allowedFile != 1)
    {
        $last_message='MIMETYPE: ' . $_FILES['file']['type'] . ' Failed';
        header('Location:error.php?ec=13&last_message=' . urlencode($last_message));
        exit;
    }