Skip to content

Commit

Permalink
GH-150 Pass input as arg to prevent hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Mar 22, 2022
1 parent 1b932d5 commit 35f0bfb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reg_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
use UniEngine\Engine\Modules\Session;
use UniEngine\Engine\Modules\Registration;

function handleRegistration() {
function handleRegistration(&$input) {
global $_EnginePath, $_Lang, $_GameConfig;

header('access-control-allow-origin: *');

if (!isset($_GET['register'])) {
if (!isset($input['register'])) {
header('Location: index.php');
die('regCallback({});');

Expand All @@ -32,7 +32,7 @@ function handleRegistration() {
'BadFields' => [],
];

$normalizedInput = Registration\Input\normalizeUserInput($_GET);
$normalizedInput = Registration\Input\normalizeUserInput($input);
$userSessionIP = Users\Session\getCurrentIP();

$validationResults = Registration\Validators\validateInputs(
Expand Down Expand Up @@ -272,6 +272,6 @@ function handleRegistration() {
die('regCallback('.json_encode($JSONResponse).');');
}

handleRegistration();
handleRegistration($_GET);

?>

0 comments on commit 35f0bfb

Please sign in to comment.