Stripslashes
-
When this plugin is enabled all posts below the first post with a bpfb attachment but without bpfb attachments in them will not have backslashes used to escape quotes stripped from the content.
This seems to be caused by the function on lines 120-127 of file class_bpfb_codec.php
public function do_shortcode ($content='') { if (false === strpos($content, '[bpfb_')) return $content; remove_filter('bp_get_activity_content_body', 'stripslashes_deep', 5); // Drop this because we'll be doing this right now $content = stripslashes_deep($content); // ... and process immediately, before allowing shortcode processing return do_shortcode($content); }
The stripslashes_deep filter is removed the first time there is a bpfb attachment but then it is never restored for the rest of the loop.
Changing the function to this resolved the issue for me:
public function do_shortcode ($content='') { if (false === strpos($content, '[bpfb_')) { if (has_filter('bp_get_activity_content_body', 'stripslashes_deep') === false) add_filter('bp_get_activity_content_body', 'stripslashes_deep', 5); return $content; } remove_filter('bp_get_activity_content_body', 'stripslashes_deep', 5); // Drop this because we'll be doing this right now $content = stripslashes_deep($content); // ... and process immediately, before allowing shortcode processing return do_shortcode($content); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Stripslashes’ is closed to new replies.