tigase / tigase-server

(M) Highly optimized, extremely modular and very flexible XMPP/Jabber server
https://tigase.net
GNU Affero General Public License v3.0
322 stars 107 forks source link

Tigase special characters #20

Open Ucheha opened 4 years ago

Ucheha commented 4 years ago

Tigase is not escaping special characters when sending stanza to the clients. special characters like [ @ %^&) > ] ..

sending special characters from client A to client B tigase shows that message sent, but it can't be parsed at client side.

Question : handling special characters should be done at server side ? (tigase plugin for example ) ? or it should be handled at client side ?

I've tested it on android client .

hantu85 commented 4 years ago

Why it should? XMPP client is required by the XMPP standard to send valid XML to the XMPP server. According to the XML specifications, some characters are not allowed in the XML or need to be escaped (as they have special meaning). Those characters (listed by XML specification) should be escaped by the XMPP client before sending those chars to the XMPP server.

It would be good to mention that not all characters which you mentioned need to be escaped, ie. @, %, ^, [, ], (, ) are valid XML characters not needed to be escaped. Escaping is required for <, >, &, ', " characters.