WordPress.org

Make WordPress Core

Changeset 14214


Ignore:
Timestamp:
04/24/10 03:53:47 (4 years ago)
Author:
dd32
Message:

Add descriptive error messages on Custom Fields updates attempting to set a empty Key or Value. Fixes #11650

File:
1 edited

Legend:

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

    r14164 r14214  
    841841        $key = $_POST['meta'][$mid]['key']; 
    842842        $value = $_POST['meta'][$mid]['value']; 
     843        if ( '' == trim($key) ) 
     844            die(__('Please provide a custom field name.')); 
     845        if ( '' == trim($value) ) 
     846            die(__('Please provide a custom field value.')); 
    843847        if ( !$meta = get_post_meta_by_id( $mid ) ) 
    844848            die('0'); // if meta doesn't exist 
Note: See TracChangeset for help on using the changeset viewer.