|
@@ -120,7 +120,7 @@ class UrlGenerator implements UrlGeneratorInterface
|
|
$optional = true;
|
|
$optional = true;
|
|
foreach ($tokens as $token) {
|
|
foreach ($tokens as $token) {
|
|
if ('variable' === $token[0]) {
|
|
if ('variable' === $token[0]) {
|
|
- if (false === $optional || !array_key_exists($token[3], $defaults) || (isset($parameters[$token[3]]) && $parameters[$token[3]] != $defaults[$token[3]])) {
|
|
|
|
|
|
+ if (false === $optional || !array_key_exists($token[3], $defaults) || (isset($parameters[$token[3]]) && (string) $parameters[$token[3]] != (string) $defaults[$token[3]])) {
|
|
if (!$isEmpty = in_array($tparams[$token[3]], array(null, '', false), true)) {
|
|
if (!$isEmpty = in_array($tparams[$token[3]], array(null, '', false), true)) {
|
|
// check requirement
|
|
// check requirement
|
|
if ($tparams[$token[3]] && !preg_match('#^'.$token[2].'$#', $tparams[$token[3]])) {
|
|
if ($tparams[$token[3]] && !preg_match('#^'.$token[2].'$#', $tparams[$token[3]])) {
|