Opened 17 years ago
Closed 17 years ago
#11506 closed defect (bug) (fixed)
Creation of unnamed option is possible
| Reported by: | hakre | Owned by: | ericmann |
|---|---|---|---|
| Priority: | lowest | Milestone: | 3.0 |
| Component: | General | Version: | 2.9 |
| Severity: | trivial | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
I just looked into the DB on a wordpress setup and the otpion table contained an option with an empty option_name.
Not shure if this exactly is a bug but I would argue that an option should have a name otherwise it might not be possible to query it.
Attachments (2)
Change History (9)
#2
@
17 years ago
- Priority normal → lowest
- Severity normal → trivial
Just tested this:
update_option('', '');
it does create an option with an empty name.
but it's not really a bug because it can be queried by get_option() properly. so nothing critical I assume.
#3
@
17 years ago
- Keywords has_patch needs_testing added
- Owner set to
- Status new → accepted
The patch I just added will check to see if $option_name is empty or blank (whitespace) before adding it to the options table. If the $option_name is invalid, update_option() will return false.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I agree. If the option name is empty, it should not be inserted into the table.