Make WordPress Core


Ignore:
Timestamp:
06/27/2011 03:56:42 PM (14 years ago)
Author:
ryan
Message:

Hardening. Santizers for WPLANG and new_admin_email. Prevent stomping ID and filter. Validate locale filename. Props westi.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r18331 r18346  
    142142    if ( empty($post_data) )
    143143        $post_data = &$_POST;
     144
     145    // Clear out any data in internal vars.
     146    if ( isset( $post_data['filter'] ) )
     147        unset( $post_data['filter'] );
    144148
    145149    $post_ID = (int) $post_data['post_ID'];
     
    559563            return edit_post();
    560564        }
     565    }
     566
     567    // Edit don't write if we have a post id.
     568    if ( isset( $_POST['ID'] ) ) {
     569        $_POST['post_ID'] = $_POST['ID'];
     570        unset ( $_POST['ID'] );
     571    }
     572    if ( isset( $_POST['post_ID'] ) ) {
     573        return edit_post();
    561574    }
    562575
Note: See TracChangeset for help on using the changeset viewer.