Skip to content

Commit

Permalink
switch $scriptDynamicEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Aug 27, 2020
1 parent 9a004dc commit 64897e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/system/httpheaders/httpheaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ private function setCspHeader(): void
}

// Add strict-dynamic to the script-src directive when enabled
if ($cspValue->directive === 'script-src'
&& strpos($cspValue->value, 'strict-dynamic') === 0
&& $scriptDynamicEnabled)
if ($scriptDynamicEnabled
&& $cspValue->directive === 'script-src'
&& strpos($cspValue->value, 'strict-dynamic') === 0)
{
$cspValue->value .= " 'strict-dynamic' ";
}
Expand Down Expand Up @@ -459,9 +459,9 @@ private function compileAutomaticCspHeaderRules(): array
}

// Add strict-dynamic to the script-src directive when enabled
if ($cspHeaderkey === 'script-src'
&& strpos($cspHeaderValue, 'strict-dynamic') === 0
&& $scriptDynamicEnabled)
if ($scriptDynamicEnabled
&& $cspHeaderkey === 'script-src'
&& strpos($cspHeaderValue, 'strict-dynamic') === 0)
{
$cspHeaderValue .= " 'strict-dynamic' ";
}
Expand Down

0 comments on commit 64897e8

Please sign in to comment.