For the last month or so I’ve been working on a patch to move the “stripslashes” functionality from the WordPress “model” API functions to the “controller” code (where it belongs). This change will mean that you don’t have to call add_magic_quotes()
around your data when passing it to wp_insert_post()
, wp_insert_user()
, etc. As hardly any developers know to do this anyway, we can pretty much consider this “fixing a bug” (which is how this patch approaches the change).
I talked this over with a few different core developers at WordCamp SF this year, and I’m very hopeful that we can land this in 3.5. Check out the ticket on Trac (#21767) to see examples and a bit more detail. Help testing and identifying any edge cases I may have missed is very much appreciated.
This post is part of the thread: WordPress Slashes – an ongoing story on this site. View the thread timeline for more context on this post.
Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions http://t.co/MPEHudlJ
Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions http://t.co/ZCWmJLeN #wordpress
[planet wordpress]: Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions: For the last month… http://t.co/YeyaGemv
Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions: For the last month or so I’ve been wor… http://t.co/9PQHvlVG
New on @alexkingorg: Big WordPress Patch: Remove “stripslashes” from API Functions http://t.co/814Tz4A9
Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions: For the last mont… http://t.co/Rj7yKMia #wordpress #wp #news
Alex King: Big WordPress Patch: Remove “stripslashes” from API Functions http://t.co/lsYmu5W7 :: @web-designs.gr
Big #WordPress patch to simplify handling JSON data. Needs testing from WP contributors. From @alexkingorg, http://t.co/CccDycFO
@geekcode This is a bug affecting all data that includes backslashes, it is not limited to JSON encoded strings.
@alexkingorg That’s when I have seen it. Though this change may require some edu for devs, similar to when sanitization got traction
@geekcode This is the opposite – instead of teaching people to do right, we’d have to teach them to do stupid. Fixing the bug is better.
Big WordPress Patch: Remove “stripslashes” from API Functions…visit: http://t.co/o7h0kpXU
Big #WordPress Patch: Remove “stripslashes” from API Functions : http://t.co/gMVp14wA http://t.co/oQ30KejX #WebDev
[…] The patch I posted about previously to improve the slash handling within WordPress for 3.5 (which fixes some core bugs and fixes tons of developer custom code bugs) is still looking promising. After setting up my unit testing environment a few days back and talking with a colleague to verify the proper approach, I began actually writing the tests today. […]
[…] was able to finish up1 the unit tests to cover the various “slashing” scenarios that my big patch is intended to address and commit those last night. With these in place, […]