diff --git a/plugins/system/httpheaders/httpheaders.php b/plugins/system/httpheaders/httpheaders.php index b552dd176b912..676668820e06e 100644 --- a/plugins/system/httpheaders/httpheaders.php +++ b/plugins/system/httpheaders/httpheaders.php @@ -429,13 +429,13 @@ private function compileAutomaticCspHeaderRules(): array } // Append the script hashes placeholder - if ($scriptHashesEnabled && strpos($cspValue->directive, 'script-src') === 0) + if ($scriptHashesEnabled && strpos($cspHeaderkey, 'script-src') === 0) { $cspHeaderValue = '{script-hashes} ' . $cspHeaderValue; } // Append the style hashes placeholder - if ($styleHashesEnabled && strpos($cspValue->directive, 'style-src') === 0) + if ($styleHashesEnabled && strpos($cspHeaderkey, 'style-src') === 0) { $cspHeaderValue = '{style-hashes} ' . $cspHeaderValue; }