From c9c38c8cd674dbb76f2795ba5d00ab39348d8402 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Tue, 28 Aug 2012 14:34:18 -0400 Subject: [PATCH] Case insensitivity on routing via Segment. --- vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php b/vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php index 6c64a96e792..62548d61940 100644 --- a/vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php +++ b/vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php @@ -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) { -- GitLab