mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-05 23:26:24 +00:00
fix(mail): don't lowercase href/action/formaction attribute value
Fixes #5434
This commit is contained in:
@@ -446,7 +446,7 @@ _xmlCharsetForCharset (NSString *charset)
|
||||
attributes: (id <SaxAttributes>) _attributes
|
||||
{
|
||||
unsigned int count, max;
|
||||
NSString *name, *value, *cid, *lowerName;
|
||||
NSString *name, *value, *cid, *lowerName, *lowerValue;
|
||||
NSMutableString *resultPart;
|
||||
BOOL skipAttribute;
|
||||
|
||||
@@ -518,11 +518,12 @@ _xmlCharsetForCharset (NSString *charset)
|
||||
|| [name isEqualToString: @"action"]
|
||||
|| [name isEqualToString: @"formaction"])
|
||||
{
|
||||
value = [[_attributes valueAtIndex: count] lowercaseString];
|
||||
skipAttribute = ([value rangeOfString: @"://"].location == NSNotFound
|
||||
&& ![value hasPrefix: @"mailto:"]
|
||||
&& ![value hasPrefix: @"#"]) ||
|
||||
[value hasPrefix: @"javascript:"];
|
||||
value = [_attributes valueAtIndex: count];
|
||||
lowerValue = [value lowercaseString];
|
||||
skipAttribute = ([lowerValue rangeOfString: @"://"].location == NSNotFound
|
||||
&& ![lowerValue hasPrefix: @"mailto:"]
|
||||
&& ![lowerValue hasPrefix: @"#"]) ||
|
||||
[lowerValue hasPrefix: @"javascript:"];
|
||||
if (!skipAttribute)
|
||||
[resultPart appendString: @" rel=\"noopener\""];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user