WordPress.org

Make WordPress Core

Changeset 23510


Ignore:
Timestamp:
02/28/13 16:49:20 (14 months ago)
Author:
nacin
Message:

Ensure we strictly compare 'alloptions' and 'notoptions' when protecting these special options.

Trim and check for emptiness of $option in delete_option(), as done for get, update, and add.

fixes #23289.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/option.php

    r22633 r23510  
    105105 */ 
    106106function wp_protect_special_option( $option ) { 
    107     $protected = array( 'alloptions', 'notoptions' ); 
    108     if ( in_array( $option, $protected ) ) 
     107    if ( 'alloptions' === $option || 'notoptions' === $option ) 
    109108        wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) ); 
    110109} 
     
    360359function delete_option( $option ) { 
    361360    global $wpdb; 
     361 
     362    $option = trim( $option ); 
     363    if ( empty( $option ) ) 
     364        return false; 
    362365 
    363366    wp_protect_special_option( $option ); 
Note: See TracChangeset for help on using the changeset viewer.