tianshanxuester / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
Other
0 stars 0 forks source link

-[GDataXMLNode setStringValue:] doesn't perform escaping of special characters. #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
Execute the following code:
    GDataXMLElement *test = [GDataXMLNode elementWithName:@"test"];
    [test setStringValue:@"test & test"];
    NSLog(@"XMLString = %@", [test XMLString]); 

What is the expected output? What do you see instead?

Expected output:
XMLString = <test>test &amp; amp</test>

Actual output:
error : unterminated entity reference            test
XMLString = <test>test </test>

Additional information:
After changing line 407 of GDataXMLNode.m to

xmlNodeSetContent(xmlNode_, xmlEncodeSpecialChars(NULL, 
GDataGetXMLString(str)));

the above example works as expected.

Original issue reported on code.google.com by rinas.al...@gmail.com on 31 May 2012 at 1:46