WordPress.org

Make WordPress Core

Ticket #23289: 23289.diff

File 23289.diff, 793 bytes (added by nacin, 5 years ago)
  • wp-includes/option.php

     
    104104 * @param string $option Option name.
    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}
    111110
     
    360359function delete_option( $option ) {
    361360        global $wpdb;
    362361
     362        $option = trim( $option );
     363        if ( empty( $option ) )
     364                return false;
     365
    363366        wp_protect_special_option( $option );
    364367
    365368        // Get the ID, if no ID then return