Monotone-Parent: 858274c7be3ad2a6383c2f85c8ad10907bb43292

Monotone-Revision: 2718d596001d2e9358dcce09a959434c8f775f9f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-05T18:50:05
This commit is contained in:
Wolfgang Sourdeau
2012-04-05 18:50:05 +00:00
parent e034585c2b
commit 823f57deca
2 changed files with 20 additions and 3 deletions
+6
View File
@@ -1,3 +1,9 @@
2012-04-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSString+Utilities.m (-objectFromJSONString):
added a work-around for JSON strings that were escaped one too
many time, in previous versions of sope-gdl1-xxx.
2012-04-04 Jean Raby <jraby@inverse.ca>
* Added a new tool: 'sogo-tool expire-sessions'
+14 -3
View File
@@ -501,6 +501,7 @@ static int cssEscapingCount;
SBJsonParser *parser;
NSObject *object;
NSError *error;
NSString *unescaped;
object = nil;
@@ -513,9 +514,19 @@ static int cssEscapingCount;
error: &error];
if (error)
{
[self errorWithFormat: @"json parser: %@", error];
[self errorWithFormat: @"original string is: %@", self];
object = nil;
[self errorWithFormat: @"json parser: %@,"
@" attempting once more after unescaping...", error];
unescaped = [self stringByReplacingString: @"\\\\"
withString: @"\\"];
object = [parser objectWithString: unescaped
error: &error];
if (error)
{
[self errorWithFormat: @"total failure. Original string is: %@", self];
object = nil;
}
else
[self logWithFormat: @"initial object deserialized successfully!"];
}
}