From 179fe8e6237589d06dceed177f726484ae675d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20HOUZE?= Date: Tue, 24 Aug 2010 13:45:14 +0200 Subject: [PATCH] Symfony\Component\Routing\Route::setRequirements() _method requirement can be an array, no substr on it --- src/Symfony/Component/Routing/Route.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index df2d448bba..64f3a2fa5e 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -197,12 +197,14 @@ class Route { $this->requirements = array(); foreach ($requirements as $key => $regex) { - if ('^' == $regex[0]) { - $regex = substr($regex, 1); - } + if (!is_array($regex)) { + if ('^' == $regex[0]) { + $regex = substr($regex, 1); + } - if ('$' == substr($regex, -1)) { - $regex = substr($regex, 0, -1); + if ('$' == substr($regex, -1)) { + $regex = substr($regex, 0, -1); + } } $this->requirements[$key] = $regex;