- π¬π§United Kingdom catch
+++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -303,7 +301,14 @@ public function generateFromRoute($name, $parameters = [], $options = [], $colle // The contexts base URL is already encoded // (see Symfony\Component\HttpFoundation\Request). - $path = str_replace($this->decodedChars[0], $this->decodedChars[1], rawurlencode($path)); + // %3A is invalid for Private folder type so unsetting it. + // %3A is invalid for Private folder type so unsetting it. + if ($name == 'system.private_file_download') { + $path = strtr(rawurlencode($path), array_diff($this->decodedChars, [':'])); + } + else { + $path = strtr(rawurlencode($path), $this->decodedChars); + }
We shouldn't need to special-case the private files route here. Having said that I don't have an idea of how to do that generically. Is it really a problem with private file downloads or is it just that this happens to be the URL used in the test?