Changeset 10853
- Timestamp:
- 06/01/2016 04:59:31 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-admin.php
r10828 r10853 580 580 // If an error occurred, pass back the activity ID that failed. 581 581 if ( $error ) 582 $redirect_to = add_query_arg( 'error', (int)$error, $redirect_to );582 $redirect_to = add_query_arg( 'error', $error, $redirect_to ); 583 583 else 584 $redirect_to = add_query_arg( 'updated', (int)$activity->id, $redirect_to );584 $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to ); 585 585 586 586 /** -
trunk/src/bp-activity/bp-activity-embeds.php
r10852 r10853 104 104 105 105 // No need to requery if we already got the embed activity 106 if ( (int) $activity_id === (int)$activity->id ) {106 if ( (int) $activity_id === $activity->id ) { 107 107 return $activities_template->has_activities(); 108 108 } -
trunk/src/bp-activity/bp-activity-functions.php
r10833 r10853 170 170 171 171 // Get activity object. 172 $activity = new BP_Activity_Activity( (int)$activity_id );172 $activity = new BP_Activity_Activity( $activity_id ); 173 173 174 174 // Try to find mentions. … … 2557 2557 2558 2558 // Check to see if the parent activity is hidden, and if so, hide this comment publicly. 2559 $is_hidden = ( (int) $activity->hide_sitewide )? 1 : 0;2559 $is_hidden = $activity->hide_sitewide ? 1 : 0; 2560 2560 2561 2561 /** -
trunk/src/bp-activity/bp-activity-screens.php
r10828 r10853 282 282 $url = sprintf( 283 283 site_url( 'wp-login.php?redirect_to=%s' ), 284 urlencode( esc_url_raw( bp_activity_get_permalink( (int)bp_current_action() ) ) )284 urlencode( esc_url_raw( bp_activity_get_permalink( bp_current_action() ) ) ) 285 285 ); 286 286 } -
trunk/src/bp-activity/bp-activity-template.php
r10825 r10853 1564 1564 // quite powerful, because doing so also deletes all comments to that 1565 1565 // activity item. We should revisit this eventually. 1566 if ( isset( $activity->user_id ) && ( (int)$activity->user_id === bp_loggedin_user_id() ) ) {1566 if ( isset( $activity->user_id ) && ( $activity->user_id === bp_loggedin_user_id() ) ) { 1567 1567 $can_delete = true; 1568 1568 } … … 1617 1617 1618 1618 // Get the ID of the parent activity content. 1619 $parent_id = (int)$activities_template->activity->item_id;1619 $parent_id = $activities_template->activity->item_id; 1620 1620 1621 1621 // Bail if no parent content. … … 1681 1681 1682 1682 // Get the ID of the parent activity content. 1683 $parent_id = (int)$activities_template->activity->item_id;1683 $parent_id = $activities_template->activity->item_id; 1684 1684 1685 1685 // Bail if no parent item. -
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r10588 r10853 108 108 * @var int 109 109 */ 110 var $hide_sitewide = false;110 var $hide_sitewide = 0; 111 111 112 112 /** … … 143 143 public function __construct( $id = false ) { 144 144 if ( !empty( $id ) ) { 145 $this->id = $id;145 $this->id = (int) $id; 146 146 $this->populate(); 147 147 } … … 176 176 $this->content = $row->content; 177 177 $this->date_recorded = $row->date_recorded; 178 $this->hide_sitewide = $row->hide_sitewide;178 $this->hide_sitewide = (int) $row->hide_sitewide; 179 179 $this->mptt_left = (int) $row->mptt_left; 180 180 $this->mptt_right = (int) $row->mptt_right; 181 $this->is_spam = $row->is_spam;181 $this->is_spam = (int) $row->is_spam; 182 182 } 183 183 … … 709 709 // Now fetch data from the cache. 710 710 foreach ( $activity_ids as $activity_id ) { 711 $activities[] = wp_cache_get( $activity_id, 'bp_activity' ); 711 // Integer casting. 712 $activity = wp_cache_get( $activity_id, 'bp_activity' ); 713 if ( ! empty( $activity ) ) { 714 $activity->id = (int) $activity->id; 715 $activity->user_id = (int) $activity->user_id; 716 $activity->item_id = (int) $activity->item_id; 717 $activity->secondary_item_id = (int) $activity->secondary_item_id; 718 $activity->hide_sitewide = (int) $activity->hide_sitewide; 719 $activity->mptt_left = (int) $activity->mptt_left; 720 $activity->mptt_right = (int) $activity->mptt_right; 721 $activity->is_spam = (int) $activity->is_spam; 722 } 723 724 $activities[] = $activity; 712 725 } 713 726 … … 1072 1085 if ( ! empty( $where_args ) ) { 1073 1086 $where_sql = 'WHERE ' . join( ' AND ', $where_args ); 1074 return $wpdb->get_var( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ); 1087 $result = $wpdb->get_var( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ); 1088 1089 return is_numeric( $result ) ? (int) $result : false; 1075 1090 } 1076 1091 … … 1764 1779 $bp = buddypress(); 1765 1780 1766 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) ); 1781 $result = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) ); 1782 1783 return is_numeric( $result ) ? (int) $result : false; 1767 1784 } 1768 1785 -
trunk/src/bp-blogs/bp-blogs-activity.php
r10731 r10853 949 949 remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment', 10, 4 ); 950 950 951 if ( 1 === (int)$activity->is_spam && 'spam' !== $post_comment_status ) {951 if ( 1 === $activity->is_spam && 'spam' !== $post_comment_status ) { 952 952 wp_spam_comment( $post_comment_id ); 953 953 } elseif ( ! $activity->is_spam ) {
Note: See TracChangeset
for help on using the changeset viewer.