mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-12 11:50:46 +00:00
#3127 properly parse the theme query
This commit is contained in:
1 parent
8cb9d7b79c
commit
ae77e63d82
3 files changed
+19
-1
No files matched your search
@@ -107,6 +107,21 @@ static const NSString *kJwtKey = @"jwt";
|
||||
return cookieLogin;
|
||||
}
|
||||
|
||||
/* JavaScript string literal of the cookie username, safe to write inside a
|
||||
<script> element: '<', '>' and '&' are escaped so the value can't close
|
||||
the element. */
|
||||
- (NSString *) cookieUsernameAsJSString
|
||||
{
|
||||
NSString *value;
|
||||
|
||||
value = [[self cookieUsername] doubleQuotedString];
|
||||
value = [value stringByReplacingString: @"<" withString: @"\\u003c"];
|
||||
value = [value stringByReplacingString: @">" withString: @"\\u003e"];
|
||||
value = [value stringByReplacingString: @"&" withString: @"\\u0026"];
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (BOOL) rememberLogin
|
||||
{
|
||||
return ([[self cookieUsername] length]);
|
||||
|
||||
@@ -745,6 +745,9 @@ static SoProduct *commonProduct = nil;
|
||||
theme = [[context request] formValueForKey: @"theme"];
|
||||
if ([theme length])
|
||||
{
|
||||
// The value is decoded: encode it again so that it can't inject
|
||||
// characters (eg. CR/LF) into the Location header
|
||||
theme = [theme stringByEscapingURL];
|
||||
url = [NSURL URLWithString: newLocation];
|
||||
query = [url query];
|
||||
if ([query length])
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
const:jsFiles="Main.js, Common.js"
|
||||
>
|
||||
<script type="text/javascript" var:nonce="cspNonce">
|
||||
var cookieUsername = <var:string var:value="cookieUsername.doubleQuotedString" const:escapeHTML="NO"/>;
|
||||
var cookieUsername = <var:string var:value="cookieUsernameAsJSString" const:escapeHTML="NO"/>;
|
||||
var language = '<var:string var:value="language" const:escapeHTML="NO"/>';
|
||||
var loginHint = '<var:string var:value="getLoginHint" const:escapeHTML="NO"/>'
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user