- Timestamp:
- 08/22/2016 10:38:28 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-profiledata.php
r10921 r11030 98 98 99 99 if ( $profiledata ) { 100 $this->id = $profiledata->id;101 $this->user_id = $profiledata->user_id;102 $this->field_id = $profiledata->field_id;100 $this->id = (int) $profiledata->id; 101 $this->user_id = (int) $profiledata->user_id; 102 $this->field_id = (int) $profiledata->field_id; 103 103 $this->value = stripslashes( $profiledata->value ); 104 104 $this->last_updated = $profiledata->last_updated; … … 106 106 } else { 107 107 // When no row is found, we'll need to set these properties manually. 108 $this->field_id = $field_id;109 $this->user_id = $user_id;108 $this->field_id = (int) $field_id; 109 $this->user_id = (int) $user_id; 110 110 } 111 111 } … … 340 340 } 341 341 342 // Integer casting. 343 foreach ( (array) $data as $key => $d ) { 344 if ( isset( $data[ $key ]->id ) ) { 345 $data[ $key ]->id = (int) $data[ $key ]->id; 346 } 347 if ( isset( $data[ $key ]->user_id ) ) { 348 $data[ $key ]->user_id = (int) $data[ $key ]->user_id; 349 } 350 351 $data[ $key ]->field_id = (int) $data[ $key ]->field_id; 352 } 353 342 354 return $data; 343 355 } … … 417 429 } 418 430 419 return $fielddata_id;431 return (int) $fielddata_id; 420 432 } 421 433 … … 495 507 } 496 508 509 // Integer casting. 510 foreach ( (array) $data as $key => $d ) { 511 if ( isset( $data[ $key ]->id ) ) { 512 $data[ $key ]->id = (int) $data[ $key ]->id; 513 } 514 if ( isset( $data[ $key ]->user_id ) ) { 515 $data[ $key ]->user_id = (int) $data[ $key ]->user_id; 516 } 517 518 $data[ $key ]->field_id = (int) $data[ $key ]->field_id; 519 } 520 497 521 // If a single ID was passed, just return the value. 498 522 if ( $return_single_result ) {
Note: See TracChangeset
for help on using the changeset viewer.