summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/protect/math-fallback.php')
-rw-r--r--plugins/jetpack/modules/protect/math-fallback.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/protect/math-fallback.php b/plugins/jetpack/modules/protect/math-fallback.php
index 69d283e7..94b5d942 100644
--- a/plugins/jetpack/modules/protect/math-fallback.php
+++ b/plugins/jetpack/modules/protect/math-fallback.php
@@ -37,7 +37,9 @@ if ( ! class_exists( 'Jetpack_Protect_Math_Authenticate' ) ) {
$correct_ans = isset( $_POST[ 'jetpack_protect_answer' ] ) ? $_POST[ 'jetpack_protect_answer' ] : '' ;
if( isset( $_COOKIE[ 'jpp_math_pass' ] ) ) {
- $transient = Jetpack_Protect_Module::get_transient( 'jpp_math_pass_' . $_COOKIE[ 'jpp_math_pass' ] );
+ $jetpack_protect = Jetpack_Protect_Module::instance();
+ $transient = $jetpack_protect->get_transient( 'jpp_math_pass_' . $_COOKIE[ 'jpp_math_pass' ] );
+
if( !$transient || $transient < 1 ) {
Jetpack_Protect_Math_Authenticate::generate_math_page();
}
@@ -100,7 +102,9 @@ if ( ! class_exists( 'Jetpack_Protect_Math_Authenticate' ) ) {
Jetpack_Protect_Math_Authenticate::generate_math_page(true);
} else {
$temp_pass = substr( sha1( rand( 1, 100000000 ) . get_site_option( 'jetpack_protect_key' ) ), 5, 25 );
- Jetpack_Protect_Module::set_transient( 'jpp_math_pass_' . $temp_pass, 3, DAY_IN_SECONDS );
+
+ $jetpack_protect = Jetpack_Protect_Module::instance();
+ $jetpack_protect->set_transient( 'jpp_math_pass_' . $temp_pass, 3, DAY_IN_SECONDS );
setcookie('jpp_math_pass', $temp_pass, time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false);
return true;
}