Index: src/OFString+Serialization.m ================================================================== --- src/OFString+Serialization.m +++ src/OFString+Serialization.m @@ -24,18 +24,20 @@ #import "OFAutoreleasePool.h" #import "OFInvalidArgumentException.h" #import "OFMalformedXMLException.h" #import "OFUnboundNamespaceException.h" +#import "OFUnsupportedVersionException.h" int _OFString_Serialization_reference; @implementation OFString (Serialization) - (id)objectByDeserializing { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFXMLElement *root; + OFString *version; OFArray *elements; id object; @try { root = [OFXMLElement elementWithXMLString: self]; @@ -46,10 +48,21 @@ } @catch (OFUnboundNamespaceException *e) { @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; } + + version = [[root attributeForName: @"version"] stringValue]; + if (version == nil) + @throw [OFInvalidArgumentException + exceptionWithClass: [self class] + selector: _cmd]; + + if ([version decimalValue] > 0) + @throw [OFUnsupportedVersionException + exceptionWithClass: [self class] + version: version]; elements = [root elementsForNamespace: OF_SERIALIZATION_NS]; if ([elements count] != 1) @throw [OFInvalidArgumentException