WordPress.org

Make WordPress Core

#26403 closed defect (bug) (fixed)

Convert path to lower case before matching for blog

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

Description

Lets take example of blog a blog example.com/mynewblog . Some users may type it example.com/MyNewBlog, others example.com/mynewblog 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 16 months ago.
26403.diff (610 bytes) - added by markjaquith 13 months ago.
26403.2.diff (556 bytes) - added by markjaquith 13 months ago.
move the strtolower() before the last preg_replace()
26403.3.diff (507 bytes) - added by jeremyfelt 13 months ago.

Download all attachments as: .zip

Change History (12)

@codix16 months ago

comment:1 @jeremyfelt16 months 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.

comment:2 @codix16 months 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.

comment:3 @jeremyfelt14 months ago

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

@markjaquith13 months ago

@markjaquith13 months ago

move the strtolower() before the last preg_replace()

comment:4 @jeremyfelt13 months ago

  • Keywords has-patch added

26403.2.diff looks good to me.

Related: #17168

@jeremyfelt13 months ago

comment:5 @jeremyfelt13 months 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.

comment:7 @jeremyfelt13 months ago

26403.3.diff still applies cleanly to trunk.

comment:8 @nacin12 months 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.