& Or HTML entities

About three weeks ago I introduced a change that was intended to fix shortened subjects when someone used the single quote (or apostrophe) in placing an ad. In theory the change was simple, just make a call to an html entity encoder for “unsafe” characters, such as single quote, double quote, etc.

Unfortunately it also encoded the ampersand, ‘&’. Since this check would be made when an ad was submitted as well as when it was edited, an ad for a S&W pistol might be properly encoded the first time. It would display as “S&W pistol”. But behind the scenes is actually looked like “S&W pistol”. Then when the ad was edited the ampersand would be encoded again, resulting in this behind the scenes: “S&W pistol”. And that would display as “S&W pistol”.

Several people pointed it out to me, thanks guys! I found a way to fix that this afternoon, and while there are still ads out there that say &, the problem should fade away as those ads are edited or expire.

Thanks!
Chris