From: <wel...@us...> - 2009-05-01 20:47:05
|
Revision: 3603 http://planeshift.svn.sourceforge.net/planeshift/?rev=3603&view=rev Author: weltall2 Date: 2009-05-01 20:47:03 +0000 (Fri, 01 May 2009) Log Message: ----------- Escaped some text being put into xml to allow the use of special characters in text like "something" Modified Paths: -------------- trunk/src/server/bulkobjects/dictionary.cpp Modified: trunk/src/server/bulkobjects/dictionary.cpp =================================================================== --- trunk/src/server/bulkobjects/dictionary.cpp 2009-05-01 19:23:53 UTC (rev 3602) +++ trunk/src/server/bulkobjects/dictionary.cpp 2009-05-01 20:47:03 UTC (rev 3603) @@ -661,7 +661,7 @@ csString saySegment; resp.SubString(saySegment,start,end-start); // pull out the part before the [ ] printf("Say: %s\n",(const char *)saySegment); - opStr.AppendFmt("<say text=\"%s\"/>", saySegment.GetDataSafe() ); + opStr.AppendFmt("<say text=\"%s\"/>", EscpXML(saySegment.GetDataSafe()).GetDataSafe() ); } if (end == resp.Length()) // stop if at end of string already break; @@ -689,7 +689,7 @@ // If action does not start with npc's name, it is a 3rd person statement, not /me if (strncasecmp(actionSegment,npc_name,strlen(npc_name))) { - opStr.AppendFmt("<narrate text=\"%s\"/>", actionSegment.GetDataSafe() ); + opStr.AppendFmt("<narrate text=\"%s\"/>", EscpXML(actionSegment.GetDataSafe()).GetDataSafe() ); } else // now look for /me or /my because the npc name matches { @@ -697,12 +697,12 @@ if (resp[strlen(npc_name)] == '\'') // apostrophe after name means /my { actionSegment.DeleteAt(0,spc+1); - opStr.AppendFmt("<actionmy text=\"%s\"/>", actionSegment.GetDataSafe() ); + opStr.AppendFmt("<actionmy text=\"%s\"/>", EscpXML(actionSegment.GetDataSafe()).GetDataSafe() ); } else // this is a /me command { actionSegment.DeleteAt(0,spc+1); - opStr.AppendFmt("<action text=\"%s\"/>", actionSegment.GetDataSafe() ); + opStr.AppendFmt("<action text=\"%s\"/>", EscpXML(actionSegment.GetDataSafe()).GetDataSafe() ); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |