diff --git a/userpanel/index.php b/userpanel/index.php index 616e727717..20894f4fcc 100644 --- a/userpanel/index.php +++ b/userpanel/index.php @@ -253,8 +253,9 @@ if ($SESSION->islogged) { $module = isset($_GET['m']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['m']) : ''; + $function = preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['f'] ?? ''); if ($SESSION->isPasswdChangeRequired) { - if ($module != 'info' && $_GET['f'] != 'updatepinform') { + if ($module != 'info' && $function != 'updatepinform') { $SESSION->close(); header('Location: ?m=info&f=updatepinform'); die; @@ -296,7 +297,7 @@ include($module_dir . $module . DIRECTORY_SEPARATOR . 'functions.php'); - $function = isset($_GET['f']) && $_GET['f']!='' ? $_GET['f'] : 'main'; + $function = $function ?: 'main'; if (function_exists('module_'.$function)) { $to_execute = 'module_'.$function; $layout['userpanel_module'] = $module;