WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#17287 closed defect (bug) (fixed)

PHP Notice in wpmu_validate_blog_signup() when blogname is empty

Reported by: DJPaul Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: minor Version:
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

When passing an empty string as $blogname (and $blog_title, for the record) in wpmu_validate_blog_signup(), there is an empty() check, and an error is registered with the WP_Error object.

However, a PHP notice is generated by the nearby "$blogname != $maybe[0]" check. PHP reports that $maybe[0] is undefined.

(This was tested on WP 3.1.1)

Attachments (2)

17287.diff (815 bytes) - added by solarissmoke 4 years ago.
Use preg_replace instead of preg_match, avoiding extra variable
17287.2.diff (796 bytes) - added by solarissmoke 4 years ago.
Even simpler still

Download all attachments as: .zip

Change History (5)

@solarissmoke4 years ago

Use preg_replace instead of preg_match, avoiding extra variable

comment:1 @solarissmoke4 years ago

  • Keywords has-patch added

@solarissmoke4 years ago

Even simpler still

comment:2 @SergeyBiryukov4 years ago

  • Milestone changed from Awaiting Review to 3.3

The patch is still good.

comment:3 @nacin4 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [18524]:

Use preg_match more efficiently. props solarissmoke, fixes #17287.

Note: See TracTickets for help on using tickets.