Undo the part of [3855f70905bd]: It caused strings to be incorrectly escaped and causing our XML parsing to break. Rather, escape hash-symbols when parsing in XML data as not to confuse AIHTMLDecoder. Refs #8141. Fixes #12856.
authorStephen Holt <sholt@adium.im>
Wed, 26 Aug 2009 13:17:35 -0400
changeset 2597 07e07f9788a6
parent 2596 387091087c49
child 2598 08f5b3c1e169
Undo the part of [3855f70905bd]: It caused strings to be incorrectly escaped and causing our XML parsing to break. Rather, escape hash-symbols when parsing in XML data as not to confuse AIHTMLDecoder. Refs #8141. Fixes #12856.
Frameworks/Adium Framework/Source/AIXMLElement.m
Source/AIXMLChatlogConverter.m
--- a/Frameworks/Adium Framework/Source/AIXMLElement.m	Sat Aug 22 23:10:25 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIXMLElement.m	Wed Aug 26 13:17:35 2009 -0400
@@ -230,7 +230,7 @@
 			} else if ([value respondsToSelector:@selector(absoluteString)]) {
 				value = [(NSURL *)value absoluteString];
 			}
-			[string appendFormat:@" %@=\"%@\"", key, value];
+			[string appendFormat:@" %@=%@", key, [self quotedXMLAttributeValueStringForString:value]];
 		}
 	}
 	if ((![contents count]) && (selfCloses)) {
--- a/Source/AIXMLChatlogConverter.m	Sat Aug 22 23:10:25 2009 -0400
+++ b/Source/AIXMLChatlogConverter.m	Wed Aug 26 13:17:35 2009 -0400
@@ -260,6 +260,11 @@
 													withString:@"&"
 													   options:NSLiteralSearch
 														 range:NSMakeRange(0, [mutableMessage length])];
+					// Escape anchor tags
+					[mutableMessage replaceOccurrencesOfString:@"#"
+													withString:@"&#x23;"
+													   options:NSLiteralSearch
+														 range:NSMakeRange(0, [mutableMessage length])];
 					message = [mutableMessage autorelease];
 				}
 				NSString *shownSender = (senderAlias ? senderAlias : sender);