Created
September 9, 2022 16:47
-
-
Save ayhanbaris/5850e49a82c3b0f29161b5ec75f0206c to your computer and use it in GitHub Desktop.
isUploadable() detect if file is uploadable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function isUploadable($fileName) | |
{ | |
$uploadable = true; | |
if( strpos($fileName, '.php') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.js') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.sql') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.py') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.exe') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.html') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.svg') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.phtml') !== false ) { | |
$uploadable = false; | |
} | |
if( strpos($fileName, '.sh') !== false ) { | |
$uploadable = false; | |
} | |
return $uploadable; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment