Make WordPress Core


Ignore:
Timestamp:
09/28/2008 09:05:37 PM (17 years ago)
Author:
westi
Message:

Protect log out actions against CSRF. Props markjaquith and ionfish. Fixes #7790.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r9013 r9025  
    21462146        $trans['switch']['theme']      = array( __( 'Your attempt to switch to this theme: "%s" has failed.' ), 'use_id' );
    21472147
     2148        $trans['log']['out']           = array( sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'sitename' ) ), false );
     2149
    21482150        if ( isset( $trans[$verb][$noun] ) ) {
    21492151            if ( !empty( $trans[$verb][$noun][1] ) ) {
     
    21792181    if ( wp_get_referer() )
    21802182        $html .= "</p><p><a href='" . remove_query_arg( 'updated', clean_url( wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";
     2183    elseif ( 'log-out' == $action )
     2184        $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_nonce_url( site_url('wp-login.php?action=logout', 'login'), 'log-out' ) );
     2185
    21812186    wp_die( $html, $title);
    21822187}
Note: See TracChangeset for help on using the changeset viewer.