Update 'filopplasting/upload.php'

Allow users to upload files with html or htm file extensions except for when the name is index.
This commit is contained in:
William 2021-08-17 22:28:26 +00:00
parent 5d6e8efdc4
commit cfbbb29ee8

View File

@ -21,8 +21,8 @@ error_reporting(E_ALL);
$fileExt = explode('.', $fileName); $fileExt = explode('.', $fileName);
$fileActualExt = strtolower(end($fileExt)); $fileActualExt = strtolower(end($fileExt));
$banned = array('php', 'js', 'html', 'htm', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf'); $banned = array('php', 'js', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf');
$allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp'); $allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp', 'html', 'htm');
//if(in_array($fileActualExt, $banned)) //if(in_array($fileActualExt, $banned))
//{ //{
@ -35,6 +35,10 @@ error_reporting(E_ALL);
} }
} }
if ($file_name === 'index.htm' || $file_name === 'index.html') {
$fileError = 2;
}
// require "fileLogger.php"; // require "fileLogger.php";