diff --git a/core/modules/image/lib/Drupal/image/Controller/ImageStyleDownloadController.php b/core/modules/image/lib/Drupal/image/Controller/ImageStyleDownloadController.php index 478b037..2b80ca2 100644 --- a/core/modules/image/lib/Drupal/image/Controller/ImageStyleDownloadController.php +++ b/core/modules/image/lib/Drupal/image/Controller/ImageStyleDownloadController.php @@ -103,7 +103,7 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st // to denial-of-service attacks. $valid = !empty($image_style) && file_stream_wrapper_valid_scheme($scheme); if (!$this->configFactory->get('image.settings')->get('allow_insecure_derivatives')) { - $valid = $valid && $request->query->get(IMAGE_DERIVATIVE_TOKEN) === image_style_path_token($image_style->id(), $image_uri); + $valid &= $request->query->get(IMAGE_DERIVATIVE_TOKEN) === image_style_path_token($image_style->id(), $image_uri); } if (!$valid) { throw new AccessDeniedHttpException(); @@ -138,14 +138,14 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st if (!file_exists($derivative_uri)) { $lock_acquired = $this->lock->acquire($lock_name); if (!$lock_acquired) { - // Tell client to retry again in 3 seconds. Currently no browsers are known - // to support Retry-After. + // Tell client to retry again in 3 seconds. Currently no browsers are + // known to support Retry-After. throw new ServiceUnavailableHttpException(3, t('Image generation in progress. Try again shortly.')); } } - // Try to generate the image, unless another thread just did it while we were - // acquiring the lock. + // Try to generate the image, unless another thread just did it while we + // were acquiring the lock. $success = file_exists($derivative_uri) || image_style_create_derivative($image_style, $image_uri, $derivative_uri); if (!empty($lock_acquired)) {