Make WordPress Core

Changeset 13175


Ignore:
Timestamp:
02/17/2010 12:26:47 PM (17 years ago)
Author:
nacin
Message:

Fix notices, props sivel. Fixes #12122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r13132 r13175  
    1616
    1717require_once('../wp-load.php');
     18
     19if ( ! isset( $_REQUEST['action'] ) )
     20        die('-1');
     21
    1822require_once('includes/admin.php');
    1923@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
    … …  
    2327if ( ! is_user_logged_in() ) {
    2428
    25         if ( $_POST['action'] == 'autosave' ) {
     29        if ( isset( $_POST['action'] ) && $_POST['action'] == 'autosave' ) {
    2630                $id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0;
    2731
    … …  
    3034
    3135                $message = sprintf( __('<strong>ALERT: You are logged out!</strong> Could not save draft. <a href="%s" target="_blank">Please log in again.</a>'), wp_login_url() );
    32                         $x = new WP_Ajax_Response( array(
    33                                 'what' => 'autosave',
    34                                 'id' => $id,
    35                                 'data' => $message
    36                         ) );
    37                         $x->send();
    38         }
    39 
    40         if ( !empty( $_REQUEST['action']) )
     36                $x = new WP_Ajax_Response( array(
     37                        'what' => 'autosave',
     38                        'id' => $id,
     39                        'data' => $message
     40                ) );
     41                $x->send();
     42        }
     43
     44        if ( !empty( $_REQUEST['action'] ) )
    4145                do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
    4246
Note: See TracChangeset for help on using the changeset viewer.