File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Modules/CIPPCore/Public/Standards Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,17 @@ function Invoke-CIPPStandardPhishProtection {
5151"@
5252 if ($Settings.remediate -eq $true ) {
5353
54+ $malformedCSSPattern = ' \.ext-sign-in-box\s*\{\s*background-image:\s*url\(https://clone\.cipp\.app/api/PublicPhishingCheck\?Tenantid=[^&]*&URL=\);\s*\}'
55+ if ($currentBody -match $malformedCSSPattern ) {
56+ if ($Settings.remediate -eq $true ) {
57+ Write-LogMessage - API ' Standards' - tenant $tenant - message ' Attempting to fix malformed PhishProtection CSS by removing the problematic pattern' - sev Info
58+ # Remove the malformed CSS pattern
59+ $currentBody = $currentBody -replace $malformedCSSPattern , ' '
60+ # Clean up any duplicate .ext-sign-in-box entries
61+ # $currentBody = $currentBody -replace '\.ext-sign-in-box\s*\{[^}]*\}\s*\.ext-sign-in-box', '.ext-sign-in-box'
62+ }
63+ }
64+
5465 try {
5566 if (! $currentBody ) {
5667 $AddedHeaders = @ {' Accept-Language' = 0 }
You can’t perform that action at this time.
0 commit comments