Make WordPress Core


Ignore:
Timestamp:
10/13/2006 12:23:25 AM (18 years ago)
Author:
markjaquith
Message:

cleanup [4382] a bit

File:
1 edited

Legend:

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

    r4382 r4383  
    984984
    985985        if ( is_serialized($entry['meta_value']) ) {
    986             if ( 's' == $entry['meta_value']{0} ) {
     986            if ( is_serialized_string($entry['meta_value']) ) {
    987987                // this is a serialized string, so we should display it
    988988                $entry['meta_value'] = maybe_unserialize($entry['meta_value']);
     
    10691069    $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect'])));
    10701070    $metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput'])));
    1071     $metavalue = prepare_data(stripslashes((trim($_POST['metavalue']))));
     1071    $metavalue = maybe_serialize(stripslashes((trim($_POST['metavalue']))));
    10721072    $metavalue = $wpdb->escape($metavalue);
    10731073
     
    11011101function update_meta($mid, $mkey, $mvalue) {
    11021102    global $wpdb;
    1103     if ( is_serialized(stripslashes($mvalue)) ) // $mvalue looks to be already serialized, so we should serialize it again to prevent the data from coming out in a different form than it came in
    1104         $mvalue = serialize($mvalue);
     1103    $mvalue = maybe_serialize(stripslashes($mvalue));
     1104    $mvalue = $wpdb->escape($mvalue);
    11051105    $mid = (int) $mid;
    11061106    return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'");
Note: See TracChangeset for help on using the changeset viewer.