Ticket #47480: 47480.diff
File 47480.diff, 1.5 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class-wp-recovery-mode-cookie-service.php
35 35 36 36 $value = $this->generate_cookie(); 37 37 38 setcookie( RECOVERY_MODE_COOKIE, $value, 0, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); 38 /** 39 * Filter the length of time a Recovery Mode cookie is valid for. 40 * 41 * @since 5.2.0 42 * 43 * @param int $length Length in seconds. 44 */ 45 $expire = time() + apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS ); 39 46 47 setcookie( RECOVERY_MODE_COOKIE, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); 48 40 49 if ( COOKIEPATH !== SITECOOKIEPATH ) { 41 setcookie( RECOVERY_MODE_COOKIE, $value, 0, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );50 setcookie( RECOVERY_MODE_COOKIE, $value, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); 42 51 } 43 52 } 44 53 … … 83 92 return new WP_Error( 'invalid_created_at', __( 'Invalid cookie format.' ) ); 84 93 } 85 94 86 /** 87 * Filter the length of time a Recovery Mode cookie is valid for. 88 * 89 * @since 5.2.0 90 * 91 * @param int $length Length in seconds. 92 */ 95 /** This filter is documented in wp-includes/class-wp-recovery-mode-cookie-service.php */ 93 96 $length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS ); 94 97 95 98 if ( time() > $created_at + $length ) {