Make WordPress Core

Changeset 5737


Ignore:
Timestamp:
06/20/2007 07:21:08 PM (19 years ago)
Author:
markjaquith
Message:

Prevent editing of protected meta keys for 2.0.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-functions.php

    r5657 r5737  
    939939        $post_ID = (int) $post_ID;
    940940
     941        $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
     942
    941943        $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect'])));
    942944        $metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput'])));
     
    953955                if ($metakeyinput)
    954956                        $metakey = $metakeyinput; // default
     957
     958                if ( in_array($metakey, $protected) )
     959                        return false;
    955960
    956961                $result = $wpdb->query("
     
    971976function update_meta($mid, $mkey, $mvalue) {
    972977        global $wpdb;
     978
     979        $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
     980
     981        if ( in_array($mkey, $protected) )
     982                return false;
     983
    973984        $mvalue = maybe_serialize(stripslashes($mvalue));
    974985        $mvalue = $wpdb->escape($mvalue);
Note: See TracChangeset for help on using the changeset viewer.