Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#17287 closed defect (bug) (fixed)

PHP Notice in wpmu_validate_blog_signup() when blogname is empty

Reported by: djpaul's profile DJPaul Owned by: nacin's profile 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 14 years ago.
Use preg_replace instead of preg_match, avoiding extra variable
17287.2.diff (796 bytes) - added by solarissmoke 14 years ago.
Even simpler still

Download all attachments as: .zip

Change History (5)

@solarissmoke
14 years ago

Use preg_replace instead of preg_match, avoiding extra variable

#1 @solarissmoke
14 years ago

  • Keywords has-patch added

@solarissmoke
14 years ago

Even simpler still

#2 @SergeyBiryukov
14 years ago

  • Milestone changed from Awaiting Review to 3.3

The patch is still good.

#3 @nacin
13 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.