I’m developing an iPhone app, client uses HTTP POST to send messages to the server.
Server response with xml.
This is a messaging app, so users sends text messages to one another.
Now what happen if user send a text message that looks like a xml structure?
This could break the xml that the server sends to the client, how can I be sure this won’t happen?
You should put the user defined message into a CDATA section in your XML structure, this will prevent any parser from evaluating this part :
You won’t have any problem this way, as long as the user payload doesn’t contain the
]]>, but you can easily get around this.