diff --git a/classes/handler/public.php b/classes/handler/public.php index 48722a0ec..c58ac41d8 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -838,6 +838,7 @@ class Handler_Public extends Handler { function forgotpass() { startup_gettext(); + session_start(); @$hash = clean($_REQUEST["hash"]); @@ -916,8 +917,11 @@ class Handler_Public extends Handler { print ""; print ""; + $_SESSION["pwdreset:testvalue1"] = rand(1,10); + $_SESSION["pwdreset:testvalue2"] = rand(1,10); + print "
"; @@ -933,7 +937,7 @@ class Handler_Public extends Handler { $email = clean($_POST["email"]); $test = clean($_POST["test"]); - if (($test != 4 && $test != 'four') || !$email || !$login) { + if ($test != ($_SESSION["pwdreset:testvalue1"] + $_SESSION["pwdreset:testvalue2"]) || !$email || !$login) { print_error(__('Some of the required form parameters are missing or incorrect.')); print "