Use key(). Props scribu. fixes #18975

git-svn-id: https://develop.svn.wordpress.org/trunk@19095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-10-31 19:46:10 +00:00
parent 4399cf7610
commit 3ca9c1df61
1 changed files with 1 additions and 2 deletions

View File

@ -860,8 +860,7 @@ case 'add-meta' :
'supplemental' => array('postid' => $pid)
) );
} else { // Update?
$var_by_ref = array_keys( $_POST['meta'] );
$mid = (int) array_pop( $var_by_ref );
$mid = (int) key( $_POST['meta'] );
$key = stripslashes( $_POST['meta'][$mid]['key'] );
$value = stripslashes( $_POST['meta'][$mid]['value'] );
if ( '' == trim($key) )