function PathProcessorFiles::processInbound
Same name in other branches
- 9 core/modules/system/src/PathProcessor/PathProcessorFiles.php \Drupal\system\PathProcessor\PathProcessorFiles::processInbound()
- 8.9.x core/modules/system/src/PathProcessor/PathProcessorFiles.php \Drupal\system\PathProcessor\PathProcessorFiles::processInbound()
- 10 core/modules/system/src/PathProcessor/PathProcessorFiles.php \Drupal\system\PathProcessor\PathProcessorFiles::processInbound()
Overrides InboundPathProcessorInterface::processInbound
File
-
core/
modules/ system/ src/ PathProcessor/ PathProcessorFiles.php, line 19
Class
- PathProcessorFiles
- Defines a path processor to rewrite file URLs.
Namespace
Drupal\system\PathProcessorCode
public function processInbound($path, Request $request) {
if (str_starts_with($path, '/system/files/') && !$request->query
->has('file')) {
$file_path = preg_replace('|^\\/system\\/files\\/|', '', $path);
$request->query
->set('file', $file_path);
return '/system/files';
}
return $path;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.