Skip to content
Snippets Groups Projects

Update S3fsImageStyleDownloadController.php

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -55,7 +55,7 @@ class S3fsImageStyleDownloadController extends ImageStyleDownloadController {
// The $target variable for a derivative of a style has
// styles/<style_name>/... as structure, so we check if the $target variable
// starts with styles/.
$valid = !empty($image_style) && \Drupal::service('file_system')->validScheme($scheme);
$valid = !empty($image_style) && \Drupal::service('stream_wrapper_manager')->isValidScheme($scheme);
if (!$this->config('image.settings')->get('allow_insecure_derivatives') || strpos(ltrim($target, '\/'), 'styles/') === 0) {
$valid &= $request->query->get(IMAGE_DERIVATIVE_TOKEN) === $image_style->getPathToken($image_uri);
}
Loading