From 6bc11ddcfee81b52268b0d4350852e58374c52d5 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 31 Oct 2011 19:46:10 +0000 Subject: [PATCH] Use key(). Props scribu. fixes #18975 git-svn-id: http://svn.automattic.com/wordpress/trunk@19095 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 85a686ed29..0fbf0d52f8 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -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) )