Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#17287 closed defect (bug) (fixed)

PHP Notice in wpmu_validate_blog_signup() when blogname is empty

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

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 15 years ago.
Use preg_replace instead of preg_match, avoiding extra variable
17287.2.diff (796 bytes ) - added by solarissmoke 15 years ago.
Even simpler still

Download all attachments as: .zip

Change History (5)

@solarissmoke
15 years ago

Use preg_replace instead of preg_match, avoiding extra variable

#1 @solarissmoke
15 years ago

  • Keywords has-patch added

@solarissmoke
15 years ago

Even simpler still

#2 @SergeyBiryukov
15 years ago

  • Milestone Awaiting Review3.3

The patch is still good.

#3 @nacin
15 years ago

  • Owner set to nacin
  • Resolutionfixed
  • Status newclosed

In [18524]:

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

Note: See TracTickets for help on using tickets.