WordPress.org

Make WordPress Core

Ticket #11650: 11650.dif

File 11650.dif, 576 bytes (added by dd32, 4 years ago)
Line 
1Index: wp-admin/admin-ajax.php
2===================================================================
3--- wp-admin/admin-ajax.php     (revision 12551)
4+++ wp-admin/admin-ajax.php     (working copy)
5@@ -851,6 +851,8 @@
6                $mid = (int) array_pop(array_keys($_POST['meta']));
7                $key = $_POST['meta'][$mid]['key'];
8                $value = $_POST['meta'][$mid]['value'];
9+               if ( '' == trim($value) )
10+                       die(__('Please provide a custom field value.'));
11                if ( !$meta = get_post_meta_by_id( $mid ) )
12                        die('0'); // if meta doesn't exist
13                if ( !current_user_can( 'edit_post', $meta->post_id ) )