From 805004e2b518d81d507a2b45e7e3dedc866cd0f1 Mon Sep 17 00:00:00 2001
From: S H Mohanjith <moha@mohanjith.net>
Date: Wed, 4 Dec 2013 20:02:16 +0200
Subject: [PATCH] Make path lower case

---
 wp-includes/ms-settings.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php
index af2ea0d..f740569 100644
--- a/wp-includes/ms-settings.php
+++ b/wp-includes/ms-settings.php
@@ -44,6 +44,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
 	$path = preg_replace( '|([a-z0-9-]+.php.*)|', '', $_SERVER['REQUEST_URI'] );
 	$path = str_replace ( '/wp-admin/', '/', $path );
 	$path = preg_replace( '|(/[a-z0-9-]+?/).*|', '$1', $path );
+	$path = strtolower( $path );
 
 	$current_site = wpmu_current_site();
 	if ( ! isset( $current_site->blog_id ) )
-- 
1.7.11.1

From e85ff75de04acedcdb8cfb54fc9e0d83f6064c6a Mon Sep 17 00:00:00 2001
From: S H Mohanjith <moha@mohanjith.net>
Date: Wed, 4 Dec 2013 23:21:40 +0200
Subject: [PATCH] Don't do a case sensitive match of home

---
 wp-includes/class-wp.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php
index 0541d6a..1bd1655 100644
--- a/wp-includes/class-wp.php
+++ b/wp-includes/class-wp.php
@@ -164,13 +164,13 @@ class WP {
 			// requested permalink.
 			$req_uri = str_replace($pathinfo, '', $req_uri);
 			$req_uri = trim($req_uri, '/');
-			$req_uri = preg_replace("|^$home_path|i", '', $req_uri);
+			$req_uri = preg_replace("|^$home_path|", '', $req_uri);
 			$req_uri = trim($req_uri, '/');
 			$pathinfo = trim($pathinfo, '/');
-			$pathinfo = preg_replace("|^$home_path|i", '', $pathinfo);
+			$pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
 			$pathinfo = trim($pathinfo, '/');
 			$self = trim($self, '/');
-			$self = preg_replace("|^$home_path|i", '', $self);
+			$self = preg_replace("|^$home_path|", '', $self);
 			$self = trim($self, '/');
 
 			// The requested permalink is in $pathinfo for path info requests and
-- 
1.7.11.1

