Index: bp-activity-notifications.php
===================================================================
--- bp-activity-notifications.php	(revision 13499)
+++ bp-activity-notifications.php	(working copy)
@@ -41,8 +41,6 @@
 				)
 			);
 
-			/* translators: %s: the current user display name */
-			$title  = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() );
 			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
@@ -57,7 +55,6 @@
 
 		case 'update_reply':
 			$link   = bp_get_notifications_permalink();
-			$title  = __( 'New Activity reply', 'buddypress' );
 			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
@@ -76,7 +73,6 @@
 
 		case 'comment_reply':
 			$link   = bp_get_notifications_permalink();
-			$title  = __( 'New Activity comment reply', 'buddypress' );
 			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
Index: classes/class-bp-activity-activity.php
===================================================================
--- classes/class-bp-activity-activity.php	(revision 13499)
+++ classes/class-bp-activity-activity.php	(working copy)
@@ -536,9 +536,9 @@
 		}
 
 		// Spam.
-		if ( 'ham_only' == $r['spam'] ) {
+		if ( 'ham_only' === $r['spam'] ) {
 			$where_conditions['spam_sql'] = 'a.is_spam = 0';
-		} elseif ( 'spam_only' == $r['spam'] ) {
+		} elseif ( 'spam_only' === $r['spam'] ) {
 			$where_conditions['spam_sql'] = 'a.is_spam = 1';
 		}
 
Index: classes/class-bp-activity-query.php
===================================================================
--- classes/class-bp-activity-query.php	(revision 13499)
+++ classes/class-bp-activity-query.php	(working copy)
@@ -142,7 +142,7 @@
 			'IN', 'NOT IN',
 			'BETWEEN', 'NOT BETWEEN',
 			'REGEXP', 'NOT REGEXP', 'RLIKE'
-		) ) ) {
+		), true ) ) {
 			$clause['compare'] = '=';
 		}
 
@@ -155,7 +155,7 @@
 
 		// Value.
 		if ( isset( $clause['value'] ) ) {
-			if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+			if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) {
 				if ( ! is_array( $value ) ) {
 					$value = preg_split( '/[,\s]+/', $value );
 				}
@@ -162,7 +162,7 @@
 			}
 
 			// Tinyint.
-			if ( ! empty( $column ) && true === in_array( $column, array( 'hide_sitewide', 'is_spam' ) ) ) {
+			if ( ! empty( $column ) && true === in_array( $column, array( 'hide_sitewide', 'is_spam' ), true ) ) {
 				$sql_chunks['where'][] = $wpdb->prepare( "{$alias}{$column} = %d", $value );
 
 			} else {
Index: classes/class-bp-activity-template.php
===================================================================
--- classes/class-bp-activity-template.php	(revision 13499)
+++ classes/class-bp-activity-template.php	(working copy)
@@ -393,7 +393,7 @@
 	public function user_activities() {
 		if ( ( $this->current_activity + 1 ) < $this->activity_count ) {
 			return true;
-		} elseif ( ( $this->current_activity + 1 ) == $this->activity_count ) {
+		} elseif ( ( $this->current_activity + 1 ) === $this->activity_count ) {
 
 			/**
 			 * Fires right before the rewinding of activity posts.
@@ -432,7 +432,7 @@
 		}
 
 		// Loop has just started.
-		if ( $this->current_activity == 0 ) {
+		if ( $this->current_activity === 0 ) {
 
 			/**
 			 * Fires if the current activity item is the first in the activity loop.
Index: classes/class-bp-akismet.php
===================================================================
--- classes/class-bp-akismet.php	(revision 13499)
+++ classes/class-bp-akismet.php	(working copy)
@@ -81,18 +81,18 @@
 		$user_result    = bp_activity_get_meta( $activity['id'], '_bp_akismet_user_result' );
 		$desc           = '';
 
-		if ( !$user_result || $user_result == $akismet_result ) {
+		if ( !$user_result || $user_result === $akismet_result ) {
 			// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same.
-			if ( 'true' == $akismet_result && $activity['is_spam'] )
+			if ( 'true' === $akismet_result && $activity['is_spam'] )
 				$desc = __( 'Flagged as spam by Akismet', 'buddypress' );
 
-			elseif ( 'false' == $akismet_result && !$activity['is_spam'] )
+			elseif ( 'false' === $akismet_result && !$activity['is_spam'] )
 				$desc = __( 'Cleared by Akismet', 'buddypress' );
 
 		} else {
 			$who = bp_activity_get_meta( $activity['id'], '_bp_akismet_user' );
 
-			if ( 'true' == $user_result ) {
+			if ( 'true' === $user_result ) {
 				/* translators: %s: the name of the user */
 				$desc = sprintf( __( 'Flagged as spam by %s', 'buddypress' ), $who );
 			} else {
@@ -106,7 +106,7 @@
 			$b = array();
 			foreach ( $actions as $k => $item ) {
 				$b[ $k ] = $item;
-				if ( $k == 'edit' )
+				if ( $k === 'edit' )
 					$b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>';
 			}
 
@@ -142,7 +142,7 @@
 		$value   = '_bp_as_nonce_' . bp_loggedin_user_id();
 
 		// If we're in the activity stream loop, we can use the current item's ID to make the nonce unique.
-		if ( 'bp_activity_entry_comments' == current_filter() ) {
+		if ( 'bp_activity_entry_comments' === current_filter() ) {
 			$form_id .= '_' . bp_get_activity_id();
 			$value   .= '_' . bp_get_activity_id();
 		}
@@ -172,11 +172,11 @@
 	 */
 	public function check_member_activity_update( $content, $user_id, $activity_id ) {
 		// By default, only handle activity updates and activity comments.
-		if ( empty( $this->last_activity ) || !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) )
+		if ( empty( $this->last_activity ) || !in_array( $this->last_activity->type, BP_Akismet::get_activity_types(), true ) )
 			return;
 
 		// Was this $activity_id just marked as spam? If not, bail out.
-		if ( !$this->last_activity->id || $activity_id != $this->last_activity->id || 'false' == $this->last_activity->akismet_submission['bp_as_result'] )
+		if ( !$this->last_activity->id || $activity_id !== $this->last_activity->id || 'false' === $this->last_activity->akismet_submission['bp_as_result'] )
 			return;
 
 		// It was, so delete the member's latest activity update.
@@ -325,7 +325,7 @@
 	 */
 	public function mark_as_ham( $activity, $source ) {
 		// If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
-		if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
+		if ( 'true' === bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
 			$activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
 
 		/**
@@ -424,7 +424,7 @@
 		$this->last_activity->akismet_submission = $activity_data;
 
 		// Spam.
-		if ( 'true' == $activity_data['bp_as_result'] ) {
+		if ( 'true' === $activity_data['bp_as_result'] ) {
 			/**
 			 * Fires after an activity item has been proven to be spam, but before officially being marked as spam.
 			 *
@@ -571,7 +571,7 @@
 		$activity_data['blog']         = bp_get_option( 'home' );
 		$activity_data['blog_charset'] = bp_get_option( 'blog_charset' );
 		$activity_data['blog_lang']    = get_locale();
-		$activity_data['referrer']     = $_SERVER['HTTP_REFERER'];
+		$activity_data['referrer']     = isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_text_field( $_SERVER['HTTP_REFERER'] ) : "";
 		$activity_data['user_agent']   = bp_core_current_user_ua();
 		$activity_data['user_ip']      = bp_core_current_user_ip();
 
@@ -602,9 +602,9 @@
 		foreach ( $activity_data as $key => $data )
 			$query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
 
-		if ( 'check' == $check )
+		if ( 'check' === $check )
 			$path = 'comment-check';
-		elseif ( 'submit' == $check )
+		elseif ( 'submit' === $check )
 			$path = 'submit-' . $spam;
 
 		// Send to Akismet.
@@ -647,7 +647,7 @@
 	 */
 	function add_history_metabox( $screen_action ) {
 		// Only proceed if we're on the edit screen.
-		if ( 'edit' != $screen_action )
+		if ( 'edit' !== $screen_action )
 			return;
 
 		// Display meta box with a low priority (low position on screen by default).
