From cfbbb29ee8dd450658f3d81ba15a9ca419809265 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 17 Aug 2021 22:28:26 +0000 Subject: [PATCH] Update 'filopplasting/upload.php' Allow users to upload files with html or htm file extensions except for when the name is index. --- filopplasting/upload.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/filopplasting/upload.php b/filopplasting/upload.php index 4d16a1f..ac7da37 100755 --- a/filopplasting/upload.php +++ b/filopplasting/upload.php @@ -21,8 +21,8 @@ error_reporting(E_ALL); $fileExt = explode('.', $fileName); $fileActualExt = strtolower(end($fileExt)); - $banned = array('php', 'js', 'html', 'htm', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf'); - $allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp'); + $banned = array('php', 'js', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf'); + $allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp', 'html', 'htm'); //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";