Skip to content
This repository was archived by the owner on Mar 10, 2019. It is now read-only.

Commit d7086e1

Browse files
committed
make escaping cookie values optional
1 parent 2e01547 commit d7086e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

LPCookieController.j

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,18 @@ var sharedCookieControllerInstance = nil;
6060
return [self setValue:aValue forKey:aKey expirationDate:anExpirationDate path:aPath domain:nil];
6161
}
6262

63+
6364
- (void)setValue:(CPString)aValue forKey:(CPString)aKey expirationDate:(CPDate)anExpirationDate path:(CPString)aPath domain:(CPString)aDomain
65+
{
66+
return [self setValue:aValue forKey:aKey expirationDate:anExpirationDate path:aPath domain:nil escape:YES];
67+
}
68+
69+
- (void)setValue:(CPString)aValue forKey:(CPString)aKey expirationDate:(CPDate)anExpirationDate path:(CPString)aPath domain:(CPString)aDomain escape:(BOOL)shouldEscape
6470
{
6571
var cookieString = @"";
6672

6773
// Add key value pair
68-
cookieString += [CPString stringWithFormat:@"%s=%s; ", aKey, escape(aValue)];
74+
cookieString += [CPString stringWithFormat:@"%s=%s; ", aKey, shouldEscape ? escape(aValue) : aValue];
6975

7076
// Add expiration date
7177
if (anExpirationDate)

0 commit comments

Comments
 (0)