PathProcessorFiles.php in Drupal 8
File
core/modules/system/src/PathProcessor/PathProcessorFiles.php
View source
<?php
namespace Drupal\system\PathProcessor;
use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
use Symfony\Component\HttpFoundation\Request;
class PathProcessorFiles implements InboundPathProcessorInterface {
public function processInbound($path, Request $request) {
if (strpos($path, '/system/files/') === 0 && !$request->query
->has('file')) {
$file_path = preg_replace('|^\\/system\\/files\\/|', '', $path);
$request->query
->set('file', $file_path);
return '/system/files';
}
return $path;
}
}