Make WordPress Core


Ignore:
Timestamp:
06/27/2011 09:36:48 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. For 3.1.

Location:
branches/3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1

  • branches/3.1/wp-admin/includes/post.php

    r18054 r18356  
    135135    if ( empty($post_data) )
    136136        $post_data = &$_POST;
     137
     138    // Clear out any data in internal vars.
     139    if ( isset( $post_data['filter'] ) )
     140        unset( $post_data['filter'] );
    137141
    138142    $post_ID = (int) $post_data['post_ID'];
     
    552556            return edit_post();
    553557        }
     558    }
     559
     560    // Edit don't write if we have a post id.
     561    if ( isset( $_POST['ID'] ) ) {
     562        $_POST['post_ID'] = $_POST['ID'];
     563        unset ( $_POST['ID'] );
     564    }
     565    if ( isset( $_POST['post_ID'] ) ) {
     566        return edit_post();
    554567    }
    555568
Note: See TracChangeset for help on using the changeset viewer.