Make WordPress Core

Ticket #29900: 29900.txt

File 29900.txt, 906 bytes (added by noam@…, 11 years ago)

Patch #29900

Line 
1Index: wp-includes/functions.php
2===================================================================
3--- wp-includes/functions.php   (revision 29625)
4+++ wp-includes/functions.php   (working copy)
5@@ -2314,8 +2314,13 @@
6  * @param string $action The nonce action.
7  */
8 function wp_nonce_ays( $action ) {
9-       $title = __( 'WordPress Failure Notice' );
10+       $title = __( 'WordPress Notice' );
11        if ( 'log-out' == $action ) {
12+        if ( !is_user_logged_in() ) {
13+            $login_redirect = esc_url( wp_login_url() ) . '?loggedout=true';
14+            wp_redirect( $login_redirect );
15+            exit;
16+        }
17                $html = sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ) . '</p><p>';
18                $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
19                $html .= sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url( $redirect_to ) );