X-Git-Url: https://jfr.im/git/uguu.git/blobdiff_plain/4366df0a56fc76485668a71ff2acc4d8f36b2653..7bc98e88525b25f26b53a77921159a36343d1d65:/includes/core.php diff --git a/includes/core.php b/includes/core.php index 8e4c0bf..5aca11b 100644 --- a/includes/core.php +++ b/includes/core.php @@ -1,34 +1,57 @@ + +//Verify that the extension is allowed +function verify_extension($ext, $type){ + if(CONFIG_EXTENSION_BLOCKING_MODE === "WHITELIST") { + $allowed = in_array($ext, unserialize(CONFIG_ALLOWED_EXTENSIONS)); + }else{ + $allowed = !in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS)); + } + + if(!$allowed){ + if($type==='normal'){ + include_once(CONFIG_ROOT_PATH.'error_meow.php'); + exit(0); + }else{ + exit('File type not allowed.'); + } + } +}