mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-08 13:05:28 +00:00
fix?
This commit is contained in:
@@ -955,15 +955,18 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
else
|
||||
cssContent = @"";
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-left\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
if([cssContent length])
|
||||
{
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-left\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-right\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-right: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-right\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-right: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
}
|
||||
|
||||
return cssContent;
|
||||
}
|
||||
@@ -1124,15 +1127,18 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
else
|
||||
cssContent = @"";
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-(?:left|right)\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
if([cssContent length])
|
||||
{
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-left\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-right\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-right: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-right\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-right: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
}
|
||||
|
||||
return cssContent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user