Added support for entities in enclosure paths. Thanks to Stuart Morgan.

This commit is contained in:
andym committed 2007-12-04 05:37:59 +00:00
1 parent 9d342f117c
commit 8fbfa3a46f
1 file changed
+8 -1
+8 -1
View File
@@ -317,7 +317,14 @@ int compareNewsItems(id item1, id item2, void *context)
id keyEnumerator = [(NSDictionary *)websiteInfo->attributes keyEnumerator], current;
while ((current = [keyEnumerator nextObject]))
{
[enclosureDictionary setObject:[(NSDictionary *)websiteInfo->attributes objectForKey:current] forKey:current];
NSString *escapedAttributeValue = [(NSDictionary *)websiteInfo->attributes objectForKey:current];
CFStringRef attributeValue = CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (CFStringRef)escapedAttributeValue, NULL);
if (attributeValue)
{
// Do a stringWithString dance rather than just casting so that it's GC safe without using the 10.4+ CFMakeCollectable.
[enclosureDictionary setObject:[NSString stringWithString:(NSString *)attributeValue] forKey:current];
CFRelease(attributeValue);
}
}
[itemDictionaryMutable setObject: enclosureDictionary forKey: itemName];
continue;