WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#24108 closed defect (bug) (duplicate)

delete_option() does not handle blank $option values

Reported by: jsmoriss Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: General Keywords:
Focuses: Cc:

Description

Both add_option() and update_option() use the following before calling wp_protect_special_option(), but delete_option() does not:

$option = trim($option);
if ( empty($option) )
    return false;

    wp_protect_special_option( $option );

I would suggest adding it delete_option() so it can handle blank $option values more elegantly.

Attachments (1)

option.php.patch (371 bytes) - added by jsmoriss 2 years ago.

Download all attachments as: .zip

Change History (2)

@jsmoriss2 years ago

comment:1 @SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #23289.

Note: See TracTickets for help on using tickets.