Symfony\Component\Routing\Route::setRequirements() _method requirement can be an array, no substr on it
This commit is contained in:
parent
4c17ce8e5e
commit
179fe8e623
@ -197,12 +197,14 @@ class Route
|
|||||||
{
|
{
|
||||||
$this->requirements = array();
|
$this->requirements = array();
|
||||||
foreach ($requirements as $key => $regex) {
|
foreach ($requirements as $key => $regex) {
|
||||||
if ('^' == $regex[0]) {
|
if (!is_array($regex)) {
|
||||||
$regex = substr($regex, 1);
|
if ('^' == $regex[0]) {
|
||||||
}
|
$regex = substr($regex, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if ('$' == substr($regex, -1)) {
|
if ('$' == substr($regex, -1)) {
|
||||||
$regex = substr($regex, 0, -1);
|
$regex = substr($regex, 0, -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->requirements[$key] = $regex;
|
$this->requirements[$key] = $regex;
|
||||||
|
Reference in New Issue
Block a user