- Timestamp:
- 08/22/2016 10:32:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-message.php
r10421 r11028 89 89 90 90 if ( $message = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE id = %d", $id ) ) ) { 91 $this->id = $message->id;92 $this->thread_id = $message->thread_id;93 $this->sender_id = $message->sender_id;91 $this->id = (int) $message->id; 92 $this->thread_id = (int) $message->thread_id; 93 $this->sender_id = (int) $message->sender_id; 94 94 $this->subject = $message->subject; 95 95 $this->message = $message->message; … … 221 221 $bp = buddypress(); 222 222 223 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", bp_loggedin_user_id(), $thread_id ) ); 223 $query = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", bp_loggedin_user_id(), $thread_id ) ); 224 225 return is_numeric( $query ) ? (int) $query : $query; 224 226 } 225 227 … … 237 239 $bp = buddypress(); 238 240 239 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND id = %d", $user_id, $message_id ) ); 241 $query = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND id = %d", $user_id, $message_id ) ); 242 243 return is_numeric( $query ) ? (int) $query : $query; 240 244 } 241 245 … … 251 255 $bp = buddypress(); 252 256 253 return $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) ); 257 $query = $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) ); 258 259 return is_numeric( $query ) ? (int) $query : $query; 254 260 } 255 261 }
Note: See TracChangeset
for help on using the changeset viewer.