mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-22 23:02:43 +00:00
fix(mail(html)): ban "javascript:" prefix in href, action and formaction
This commit is contained in:
@@ -520,10 +520,11 @@ _xmlCharsetForCharset (NSString *charset)
|
||||
{
|
||||
value = [_attributes valueAtIndex: count];
|
||||
lowerValue = [value lowercaseString];
|
||||
skipAttribute = ([lowerValue rangeOfString: @"://"].location == NSNotFound
|
||||
&& ![lowerValue hasPrefix: @"mailto:"]
|
||||
&& ![lowerValue hasPrefix: @"#"]) ||
|
||||
[lowerValue hasPrefix: @"javascript:"];
|
||||
skipAttribute =
|
||||
([lowerValue rangeOfString: @"://"].location == NSNotFound
|
||||
&& ![lowerValue hasPrefix: @"mailto:"]
|
||||
&& ![lowerValue hasPrefix: @"#"])
|
||||
|| [lowerValue rangeOfString: @"javascript:"].location != NSNotFound;
|
||||
if (!skipAttribute)
|
||||
[resultPart appendString: @" rel=\"noopener\""];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user