diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index 4657fdf..0d04324 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -149,7 +149,7 @@ protected function getInternalPathFromRoute(SymfonyRoute $route, $parameters = a /** * {@inheritdoc} */ - public function generate($name, $parameters = array(), $absolute = FALSE) { + public function generate($name, $parameters = array(), $absolute = self::ABSOLUTE_PATH) { $options['absolute'] = $absolute; return $this->generateFromRoute($name, $parameters, $options); } diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php index ac81651..603444f 100644 --- a/core/modules/file/src/Tests/DownloadTest.php +++ b/core/modules/file/src/Tests/DownloadTest.php @@ -101,6 +101,8 @@ protected function doPrivateFileTransferTest() { */ function testFileCreateUrl() { + $urlGenerator = \Drupal::service('url_generator'); + // Tilde (~) is excluded from this test because it is encoded by // rawurlencode() in PHP 5.2 but not in PHP 5.3, as per RFC 3986. // @see http://www.php.net/manual/function.rawurlencode.php#86506 @@ -125,6 +127,7 @@ function testFileCreateUrl() { $base_path = $request->getSchemeAndHttpHost() . $request->getBasePath(); $this->checkUrl('public', '', $basename, $base_path . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . $basename_encoded); $this->checkUrl('private', '', $basename, $base_path . '/' . $script_path . 'system/files/' . $basename_encoded); + $urlGenerator->clearCache(); } $this->assertEqual(file_create_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Generated URL matches expected URL.')); }