Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: WP Integration – Slashes the root of all evil

Would the solution be to execute a stripslashes_deep on GET, POST, etc if WP_BB is true? Seems kinda dangerous – but bbpress doesn’t expect this in a non-integrated environment, so undoing what wp-settings.php does (which gets run when you include wp-config to get the WordPress API) seems harmless enough.

Maybe something along the lines of:

function bb_undo_wp_slashes() {

$_GET = stripslashes_deep($_GET );

$_POST = stripslashes_deep($_POST );

$_COOKIE = stripslashes_deep($_COOKIE);

$_SERVER = stripslashes_deep($_SERVER);

}

and call that as a filter for bb_head?

if (defined('WP_BB') && WP_BB) add_action('bb_head', 'bb_undo_wp_slashes');

I think bb_head is called after the environment is setup.

I may give this a try. Thoughts from developers who know more about bbPress than I?

Skip to toolbar