Skip to content

Commit aee9e99

Browse files
author
rvdwegen
committed
Cleanup broken CSS
1 parent 3eddb4c commit aee9e99

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardPhishProtection.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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 }

0 commit comments

Comments
 (0)