Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#26403 closed defect (bug) (fixed)

Convert path to lower case before matching for blog

Reported by: codix's profile codix Owned by: nacin's profile nacin
Milestone: 3.9 Priority: low
Severity: minor Version: 3.0
Component: Bootstrap/Load Keywords: dev-feedback has-patch
Focuses: multisite Cc:


Lets take example of blog a blog . Some users may type it, others and any variations inbetween.

There is no intensive for having mixed case blognames, it only leads to confusion among users.

Make blog path lowercase before trying to match a blog.

Patch made against trunk.

Attachments (4)

patch.diff (2.0 KB) - added by codix 10 years ago.
26403.diff (610 bytes) - added by markjaquith 10 years ago.
26403.2.diff (556 bytes) - added by markjaquith 10 years ago.
move the strtolower() before the last preg_replace()
26403.3.diff (507 bytes) - added by jeremyfelt 10 years ago.

Download all attachments as: .zip

Change History (12)

10 years ago

#1 @jeremyfelt
10 years ago

  • Keywords dev-feedback added
  • Milestone changed from Awaiting Review to 3.9
  • Priority changed from normal to low
  • Severity changed from normal to minor
  • Version changed from 3.8 to 3.0

We use strtolower() when creating new sites and users. We also use it in get_blog_id_from_url().

It seems not using strtolower() when looking for the site *could* cause an issue if the database collation was set in a way that made the query for path case sensitive. Adding that to ms-settings.php would likely not hurt.

I don't understand the removal of the case insensitive flag in parse_request(), that seems like an unnecessary change that could go against the goal of being case insensitive.

Moving to 3.9 as it's worth discussing strtolower( $path ) as part of our site matching.

#2 @codix
10 years ago

Yes, it was an old patch we had in our system. We can drop the removal of the case insensitive flag. I'm sorry for the inconvenience.

#3 @jeremyfelt
10 years ago

  • Component changed from Multisite to Bootstrap/Load
  • Focuses multisite added

10 years ago

10 years ago

move the strtolower() before the last preg_replace()

#4 @jeremyfelt
10 years ago

  • Keywords has-patch added

26403.2.diff looks good to me.

Related: #17168

10 years ago

#5 @jeremyfelt
10 years ago

26403.3.diff is a refresh against current trunk as most previous stuff is gone.

This ensures the path is all lower case, similar to how domain is already handled.

#7 @jeremyfelt
10 years ago

26403.3.diff still applies cleanly to trunk.

#8 @nacin
10 years ago

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

In 27724:

Multisite: Lowercase REQUEST_URI when matching paths.

props markjaquith, jeremyfelt.
fixes #26403.

Note: See TracTickets for help on using tickets.