|
@@ -110,7 +110,7 @@ class UrlGenerator implements UrlGeneratorInterface
|
|
|
throw new \InvalidArgumentException(sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given).', $token[3], $name, $token[2], $tparams[$token[3]]));
|
|
|
}
|
|
|
|
|
|
- if ($tparams[$token[3]] || !$optional) {
|
|
|
+ if (!in_array($tparams[$token[3]], array(null, '', false), true) || !$optional) {
|
|
|
// %2F is not valid in a URL, so we don't encode it (which is fine as the requirements explicitly allowed it)
|
|
|
$url = $token[1].str_replace('%2F', '/', urlencode($tparams[$token[3]])).$url;
|
|
|
}
|