Title: Stripslashes
Last modified: August 28, 2017

---

# Stripslashes

 *  Resolved [atmojones](https://wordpress.org/support/users/atmojones/)
 * (@atmojones)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/stripslashes-4/)
 * 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)

 *  Plugin Author [jdailey](https://wordpress.org/support/users/jdailey/)
 * (@jdailey)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/stripslashes-4/#post-9451472)
 * Thank you for sharing your solution. I will pass this along to the developers.

Viewing 1 replies (of 1 total)

The topic ‘Stripslashes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-activity-plus_db6c43.svg)
 * [BuddyPress Activity Plus](https://wordpress.org/plugins/buddypress-activity-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-activity-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-activity-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-activity-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-activity-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-activity-plus/reviews/)

## Tags

 * [slashes](https://wordpress.org/support/topic-tag/slashes/)

 * 1 reply
 * 2 participants
 * Last reply from: [jdailey](https://wordpress.org/support/users/jdailey/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/stripslashes-4/#post-9451472)
 * Status: resolved