Skip to content
Snippets Groups Projects
Commit c9c38c8c authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Case insensitivity on routing via Segment.

parent bdb9178a
No related merge requests found
......@@ -316,9 +316,11 @@ class Segment implements RouteInterface
$path = $uri->getPath();
if ($pathOffset !== null) {
$result = preg_match('(\G' . $this->regex . ')', $path, $matches, null, $pathOffset);
$pattern = '/(\G' . str_replace('/', '\/', $this->regex) . ')/i';
$result = preg_match($pattern, $path, $matches, null, $pathOffset);
} else {
$result = preg_match('(^' . $this->regex . '$)', $path, $matches);
$pattern = '/(^' . str_replace('/', '\/', $this->regex) . '$)/i';
$result = preg_match('(^' . $pattern . '$)', $path, $matches);
}
if (!$result) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment