- Timestamp:
- 08/22/2016 10:35:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r11015 r11029 98 98 public function __construct( $id = 0 ) { 99 99 if ( ! empty( $id ) ) { 100 $this->id = $id;100 $this->id = (int) $id; 101 101 $this->populate(); 102 102 } … … 186 186 // Setup the notification data. 187 187 if ( ! empty( $notification ) && ! is_wp_error( $notification ) ) { 188 $this->item_id = $notification->item_id;189 $this->secondary_item_id = $notification->secondary_item_id;190 $this->user_id = $notification->user_id;188 $this->item_id = (int) $notification->item_id; 189 $this->secondary_item_id = (int) $notification->secondary_item_id; 190 $this->user_id = (int) $notification->user_id; 191 191 $this->component_name = $notification->component_name; 192 192 $this->component_action = $notification->component_action; 193 193 $this->date_notified = $notification->date_notified; 194 $this->is_new = $notification->is_new;194 $this->is_new = (int) $notification->is_new; 195 195 } 196 196 } … … 685 685 $results = $wpdb->get_results( $sql ); 686 686 687 // Integer casting. 688 foreach ( $results as $key => $result ) { 689 $results[$key]->id = (int) $results[$key]->id; 690 $results[$key]->user_id = (int) $results[$key]->user_id; 691 $results[$key]->item_id = (int) $results[$key]->item_id; 692 $results[$key]->secondary_item_id = (int) $results[$key]->secondary_item_id; 693 $results[$key]->is_new = (int) $results[$key]->is_new; 694 } 695 687 696 // Update meta cache. 688 697 if ( true === $r['update_meta_cache'] ) { … … 741 750 742 751 // Return the queried results. 743 return $wpdb->get_var( $sql );752 return (int) $wpdb->get_var( $sql ); 744 753 } 745 754
Note: See TracChangeset
for help on using the changeset viewer.