diff --git a/index.php b/index.php index 4284189..27d9f32 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ 86400, @@ -12,7 +13,7 @@ session_set_cookie_params([ ]); session_start(); -if(!isset($_SESSION['csrf']) || strlen($_SESSION['csrf'] != 64)) { +if(!isset($_SESSION['csrf']) || strlen($_SESSION['csrf']) != 64) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } @@ -25,13 +26,10 @@ include_once("classen/GoogleAuthenticator.php"); include_once("classen/OpenSim.php"); include_once("classen/discord.php"); -$RUNTIME = array(); $RUNTIME['OPENSIM'] = new OpenSim(); -include_once("config.php"); - function isValidEndpoint(string $pageName, string $dirPrefix) { - return preg_match("[a-zA-Z0-9\.]{1,100}", $pageName) && file_exists("./".$dirPrefix."/".$pageName.".php"); + return preg_match("/[a-zA-Z0-9\.]{1,100}/", $pageName) && file_exists("./".$dirPrefix."/".$pageName.".php"); } //TODO: add API keys and/or rate limiting