Skip to content

Commit

Permalink
Fix and merge conflicts with 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Ribeiro committed Dec 3, 2024
2 parents 99546cd + cd099ff commit fa9c271
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/Headers/CSP.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function addNonce(string $header): string
$header = preg_replace($pattern, $replacement, $header) ?? '';

// Add nonce
$search = ['script-src', 'style-src'];
$search = ['script-src', 'script-src-elem', 'style-src', 'style-src-elem'];

foreach ($search as $value) {
$pattern = "/($value\s)/";
Expand Down
7 changes: 7 additions & 0 deletions src/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ function csp_nonce(): string
return Helpers::nonce();
}
}

if (!function_exists('twill_csp_nonce')) {
function twill_csp_nonce(): string
{
return Helpers::nonce();
}
}

0 comments on commit fa9c271

Please sign in to comment.