WordPress.org

Make WordPress Core

Ticket #17398: 17398.diff

File 17398.diff, 1.0 KB (added by mitchoyoshitaka, 4 years ago)
  • wp-includes/functions.php

     
    27352735function wp_nonce_ays( $action ) { 
    27362736        $title = __( 'WordPress Failure Notice' ); 
    27372737        $html = esc_html( wp_explain_nonce( $action ) ); 
    2738         if ( 'log-out' == $action ) 
    2739                 $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() ); 
    2740         elseif ( wp_get_referer() ) 
     2738        if ( 'log-out' == $action ) { 
     2739                $logout_url = wp_logout_url(); 
     2740                if ( !empty( $_REQUEST['redirect_to'] ) ) 
     2741                        $logout_url = add_query_arg( array('redirect_to' => $_REQUEST['redirect_to']), $logout_url ); 
     2742                $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), $logout_url ); 
     2743        } elseif ( wp_get_referer() ) { 
    27412744                $html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>"; 
     2745        } 
    27422746 
    27432747        wp_die( $html, $title, array('response' => 403) ); 
    27442748}