admin管理员组文章数量:1123948
Can you explain to me what the following line of code means?
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
This is because I see that this is where my code finds the hitch and fails to set the password correctly.
UPDATE:
It is normal that once the e-mail has been sent to the page, the following selection puts False and then ends up at $ user = false; ?
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
$user = check_password_reset_key( $rp_key, $rp_login );
if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
$user = false;
}
} else {
$user = false;
}
if ( ! $user || is_wp_error( $user ) ) {
setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
if ( $user && $user->get_error_code() === 'expired_key' ) {
wp_redirect( site_url( 'prova/?action=lostpassword&error=expiredkey' ) );
} else {
wp_redirect( site_url( 'prova/?action=lostpassword&error=invalidkey' ) );
}
exit;
}
Thanks a lot to those who will help me.
Can you explain to me what the following line of code means?
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
This is because I see that this is where my code finds the hitch and fails to set the password correctly.
UPDATE:
It is normal that once the e-mail has been sent to the page, the following selection puts False and then ends up at $ user = false; ?
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
$user = check_password_reset_key( $rp_key, $rp_login );
if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
$user = false;
}
} else {
$user = false;
}
if ( ! $user || is_wp_error( $user ) ) {
setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
if ( $user && $user->get_error_code() === 'expired_key' ) {
wp_redirect( site_url( 'prova/?action=lostpassword&error=expiredkey' ) );
} else {
wp_redirect( site_url( 'prova/?action=lostpassword&error=invalidkey' ) );
}
exit;
}
Thanks a lot to those who will help me.
Share Improve this question edited Sep 3, 2019 at 8:39 Matteo Feduzi asked Sep 3, 2019 at 7:14 Matteo FeduziMatteo Feduzi 299 bronze badges1 Answer
Reset to default 0If the cookie named $rp_cookie exists and if the colon character (:) in the cookie is not the first character, then…
本文标签: user accessI can39t recover my password
版权声明:本文标题:user access - I can't recover my password 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736610298a1945428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论