viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]
diff --git a/src/controllers/ResourceController.php b/src/controllers/ResourceController.php index fa9d1e43f..553e31edd 100644 --- a/src/controllers/ResourceController.php +++ b/src/controllers/ResourceController.php @@ -169,7 +169,14 @@ class ResourceController extends Controller implements CrawlConstants } } } - if ( file_exists($path)) { + $alt_path = $path; + if (substr($path, -4) == 'webp') { + $alt_path = substr($path, 0, -4) . "jpg"; + if (!file_exists($path) && file_exists($alt_path)) { + $path = $alt_path; + } + } + if (file_exists($path)) { $path = realpath($path); $mime_type = L\mimeType($path); $mime_parts = explode("/", $mime_type);