WordPress.org

Make WordPress Core

Ticket #34537: big_patch.diff

File big_patch.diff, 1.2 KB (added by musus, 4 years ago)
  • src/wp-admin/admin-ajax.php

     
    2525send_origin_headers();
    2626
    2727// Require an action parameter
    28 if ( empty( $_REQUEST['action'] ) )
     28if ( empty( $_REQUEST['action'] ) ) {
    2929        die( '0' );
     30}
    3031
    3132/** Load WordPress Administration APIs */
    3233require_once( ABSPATH . 'wp-admin/includes/admin.php' );
     
    6970$core_actions_post[] = 'wp-fullscreen-save-post';
    7071
    7172// Register core Ajax calls.
    72 if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
     73if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) {
    7374        add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
     75}
    7476
    75 if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) )
     77if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
    7678        add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
     79}
    7780
    7881add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );
    7982