Skip to content

Instantly share code, notes, and snippets.

@imcbride
Created July 15, 2021 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imcbride/dfe6467727161558b61ac18493f844fa to your computer and use it in GitHub Desktop.
Save imcbride/dfe6467727161558b61ac18493f844fa to your computer and use it in GitHub Desktop.
diff --git a/file_version.info.yml b/file_version.info.yml
index 2ff4eb5..03add15 100644
--- a/file_version.info.yml
+++ b/file_version.info.yml
@@ -1,5 +1,5 @@
name: File Version
-# core: 8.x
+core_version_requirement: ^8.8 || ^9
description: Add simple token in files urls based on file modified time to ease cache files in CDNs.
type: module
configure: file_version.admin_settings
@@ -8,6 +8,5 @@ dependencies:
# Information added by Drupal.org packaging script on 2018-05-11
version: '8.x-1.0'
-core: '8.x'
project: 'file_version'
datestamp: 1526034788
diff --git a/src/FileVersion.php b/src/FileVersion.php
index 580011a..45c9050 100644
--- a/src/FileVersion.php
+++ b/src/FileVersion.php
@@ -99,7 +99,7 @@ class FileVersion implements FileVersionInterface {
* TRUE if is the uri is an image style uri, FALSE in otherwise.
*/
private function isImageStyleUri($uri) {
- $target = file_uri_target($uri);
+ $target = \Drupal::service('stream_wrapper_manager')->getTarget($uri);
if ($target) {
$prefixes_pattern = preg_quote(static::IMAGE_STYLE_URI_TARGET_PREFIX, '/');
$pattern = '/^' . $prefixes_pattern . '/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment