From ce2f9058dc002beff86c67f77d00caa9adb42e56 Mon Sep 17 00:00:00 2001 From: "E. S." Date: Thu, 15 May 2025 17:00:31 +0300 Subject: [PATCH] skin: move enable_assets_integrity option to config --- config.yaml.example | 1 + src/engine/skin/FeaturedSkin.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.yaml.example b/config.yaml.example index 0383ec7..222bd9d 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -37,6 +37,7 @@ wiki_root: wiki skin_cache_prod_dir: replace_with_path_twig_cache_dir_on_prod skin_cache_dev_dir: replace_with_path_twig_cache_dir_on_dev +enable_assets_integrity: yes git_repo: git@github.com:example/example_org.git diff --git a/src/engine/skin/FeaturedSkin.php b/src/engine/skin/FeaturedSkin.php index 163551a..41281a8 100644 --- a/src/engine/skin/FeaturedSkin.php +++ b/src/engine/skin/FeaturedSkin.php @@ -294,7 +294,8 @@ HTML; } protected function getStaticIntegrityAttribute(string $name): string { - if (isDev() || !isset($_GET['__enable_assets_integrity'])) + global $config; + if (isDev() || !$config['enable_assets_integrity']) return ''; global $config, $globalContext; return ' integrity="'.implode(' ', array_map(fn($hash_type) => $hash_type.'-'.$config['assets'][$globalContext->project][$name]['integrity'][$hash_type], self::RESOURCE_INTEGRITY_HASHES)).'"';