diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field.php b/src/bp-xprofile/classes/class-bp-xprofile-field.php
index 11c48fd..9128cc5 100644
a
|
b
|
class BP_XProfile_Field { |
263 | 263 | $args = (array) $args; |
264 | 264 | } |
265 | 265 | |
| 266 | $int_fields = array( |
| 267 | 'can_delete', |
| 268 | 'field_order', |
| 269 | 'group_id', |
| 270 | 'id', |
| 271 | 'is_default_option', |
| 272 | 'is_required', |
| 273 | 'option_order', |
| 274 | 'parent_id', |
| 275 | ); |
| 276 | |
266 | 277 | foreach ( $args as $k => $v ) { |
267 | 278 | if ( 'name' === $k || 'description' === $k ) { |
268 | 279 | $v = stripslashes( $v ); |
| 280 | } elseif ( in_array( $k, $int_fields, true ) ) { |
| 281 | $v = absint( $v ); |
269 | 282 | } |
| 283 | |
270 | 284 | $this->{$k} = $v; |
271 | 285 | } |
272 | 286 | |
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-group.php b/src/bp-xprofile/classes/class-bp-xprofile-group.php
index 408d222..abd1db7 100644
a
|
b
|
class BP_XProfile_Group { |
553 | 553 | // and add it to the cache. |
554 | 554 | foreach ( (array) $queried_gdata as $gdata ) { |
555 | 555 | |
| 556 | // Enforce type. |
| 557 | foreach ( $gdata as $k => &$v ) { |
| 558 | if ( in_array( $k, array( 'can_delete', 'group_order', 'id', ), true ) ) { |
| 559 | $v = absint( $v ); |
| 560 | } |
| 561 | } |
| 562 | |
556 | 563 | // Add group to groups array. |
557 | 564 | $groups[ $gdata->id ] = $gdata; |
558 | 565 | |