[wp-hackers] The \ problem in posts

Ryan Boren ryan at boren.nu
Wed Jun 23 23:44:47 UTC 2004


On Wed, 2004-06-23 at 16:32, Alex King wrote:
> I'm not 100% sure, but I think a bug was fixed in 1.2 that kept quotes 
> from being double escaped, but there wasn't an accompanying upgrade 
> script that removed the extra backslashes from posts that already 
> existed in the database. The new code doesn't remove those like the old 
> code did, and adding a stripslashes() into the filters works great for 
> old posts but eats slashes in new posts because the new posts aren't 
> double-escaped.
> 
> Have I got this right?

Right you are.  Current CVS should have this fixed.  Dozens of calls to
stripslashes() have been removed.  We still have some more that need to
be dealt with.  Double-escaping problems in old posts are fixed during
upgrade.

Ryan

> On Jun 23, 2004, at 3:28 PM, Matthew Thomas wrote:
> 
> > On 24 Jun, 2004, at 7:36 AM, Carthik Sharma wrote:
> >> ...
> >> There is a problem with wordpress eating the '\' character wherever 
> >> it appears in a post.
> >>
> >> I was wondering if there is any specific reason why the
> >> convert_chars() function does not replace the \ character in posts 
> >> with \ , seeing as wordpress eats all the backslashes in posts? 
> >> (just like it replaces the & with & )
> >
> > Why not just fix the bug? People have to put up with & because "&" 
> > is special -- it begins (X)HTML entities. Why is "\" special?
> >
> > -- 
> > Matthew Thomas
> > http://mpt.net.nz/





More information about the hackers mailing list