Page 1 of 1
text replacement
Posted: Tue Mar 21, 2006 1:55 am
by s.dot
my text that replaces smilies looks something like this
Code: Select all
$smileys = array(';-d',';d',';-D',';D');
[php]
For some reason, typing the word "i'd" triggers one of those. why is that?[/php]
Posted: Tue Mar 21, 2006 4:47 am
by Maugrim_The_Reaper
;d
I wonder what happens if you entitise something before a d character? Example:
"d
See anything familiar?

You might be running the replacement on entitised text (maybe via htmlentities()). May need to undo this, or run the replacement before the text is entitised.
Well, that's my 2c on the possible problem...
Posted: Tue Mar 21, 2006 6:26 pm
by s.dot
Ah, very good observation.
Posted: Wed Mar 22, 2006 12:57 am
by matthijs
scrotaye, I noticed you're quite busy with your smilie thing, as I've seen a few posts about it from you. As I'm also working on implementing smilie replacement in a little script, I was wondering if you would like to share some ideas? The subject of this thread made me aware of the fact I will run into the exact same problem as you did
Furthermore, as I have it implemented in my script now, I find it kind of hackery. Everything hardcoded all over the place, inline javascript to insert the smilies, not flexible, etc. So if you would like to share some ideas, snippets of code or have links to good examples, that would be cool.