View Single Post
  #5  
Old 04-17-2008, 10:09 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Thanks to Tig for some ingame help. Unfortunately we couldn't come up with an efficient way that works, but after he left, I still had an idea and turned it into something that seems to be pretty efficient. Not as much as other things, but it's still working and doesn't eat alot of CPU.
If anybody else is looking for a solution, I'm going to share this with you. It eliminates the backslashes that are created by escape(), and only those.

PHP Code:
while (newChat.pos("\\\"") > -|| newChat.pos("\\'") > -|| newChat.pos("\\\\") > -1) { //"
  
if (newChat.pos("\\\"") > -1//"
    
newChat newChat.substring(0newChat.pos("\\\"")) @ newChat.substring(newChat.pos("\\\"") + 1);
  else if (
newChat.pos("\\'") > -1)
    
newChat newChat.substring(0newChat.pos("\\'")) @ newChat.substring(newChat.pos("\\'") + 1);
  else
    
newChat newChat.substring(0newChat.pos("\\\\")) @ newChat.substring(newChat.pos("\\\\") + 1);

There are some comments here and there with just a quotation mark. I added those to fix the syntax highlighting that has some problems with the escaped quotation mark.
Reply With Quote