unserialize serialized strings for ajax custom field addition. fixes #2591

git-svn-id: http://svn.automattic.com/wordpress/trunk@4418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-10-24 09:14:47 +00:00
parent 0fd28b6d83
commit 4c586e45ff
1 changed files with 4 additions and 1 deletions

View File

@ -1107,7 +1107,10 @@ function get_post_meta_by_id($mid) {
global $wpdb;
$mid = (int) $mid;
return $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'");
$meta = $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'");
if ( is_serialized_string($meta->meta_value) )
$meta->meta_value = maybe_unserialize($meta->meta_value);
return $meta;
}
function touch_time($edit = 1, $for_post = 1) {