diff --git a/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php b/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php index 46dad9e..3febe1c 100644 --- a/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php @@ -103,7 +103,7 @@ function testFileCreateUrl() { $script_path_original = $script_path; foreach (array('', 'index.php/') as $script_path) { $this->checkUrl('public', '', $basename, $base_url . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . $basename_encoded); - $this->checkUrl('private', '', $basename, url($base_url . '/' . $script_path . 'system/files', array('query' => array('file' => $basename_encoded)))); + $this->checkUrl('private', '', $basename, $base_url . '/' . $script_path . 'system/files?file=' . $basename_encoded); } $script_path = $script_path_original; } diff --git a/core/modules/system/lib/Drupal/system/FileController.php b/core/modules/system/lib/Drupal/system/FileController.php index 349e373..2478c3b 100644 --- a/core/modules/system/lib/Drupal/system/FileController.php +++ b/core/modules/system/lib/Drupal/system/FileController.php @@ -8,8 +8,8 @@ namespace Drupal\system; use Drupal\Core\Extension\ModuleHandler; -use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Controller\ControllerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -21,13 +21,8 @@ class FileController implements ControllerInterface { /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('module_handler')); - } - - /** + * Constructs a FileController object. + * * @param \Drupal\Core\Extension\ModuleHandler $module_handler * The module handler. */ @@ -36,6 +31,13 @@ public function __construct(ModuleHandler $module_handler) { } /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static($container->get('module_handler')); + } + + /** * Handles private file transfers. * * Call modules that implement hook_file_download() to find out if a file is @@ -47,7 +49,7 @@ public function __construct(ModuleHandler $module_handler) { * * @see hook_file_download() */ - function fileDownload(Request $request, $scheme) { + public function fileDownload(Request $request, $scheme) { $target = $request->query->get('file'); // Merge remaining path arguments into relative file path. $uri = $scheme . '://' . $target;