Changeset 7469
- Timestamp:
- 10/23/2013 06:47:16 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r7448 r7469 681 681 682 682 // Sanitize value 683 if ( is_string( $meta_value ) ) 684 $meta_value = stripslashes( esc_sql( $meta_value ) ); 683 if ( is_string( $meta_value ) ) { 684 $meta_value = stripslashes( $meta_value ); 685 } 685 686 686 687 // Maybe, just maybe... serialize -
trunk/bp-groups/bp-groups-functions.php
r7442 r7469 1056 1056 $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key ); 1057 1057 1058 if ( is_string( $meta_value ) ) 1059 $meta_value = stripslashes( esc_sql( $meta_value ) ); 1058 if ( is_string( $meta_value ) ) { 1059 $meta_value = stripslashes( $meta_value ); 1060 } 1060 1061 1061 1062 $meta_value = maybe_serialize( $meta_value ); -
trunk/bp-xprofile/bp-xprofile-functions.php
r7365 r7469 589 589 $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key ); 590 590 591 if ( is_string( $meta_value ) ) 592 $meta_value = stripslashes( esc_sql( $meta_value ) ); 591 if ( is_string( $meta_value ) ) { 592 $meta_value = stripslashes( $meta_value ); 593 } 593 594 594 595 $meta_value = maybe_serialize( $meta_value ); -
trunk/tests/testcases/activity/functions.php
r7422 r7469 87 87 $this->assertEquals( false, $m3 ); 88 88 } 89 90 /** 91 * @group bp_activity_update_meta 92 * @ticket BP5180 93 */ 94 public function test_bp_activity_update_meta_with_line_breaks() { 95 $a = $this->factory->activity->create(); 96 $meta_value = 'Foo! 97 98 99 Bar!'; 100 bp_activity_update_meta( $a, 'linebreak_test', $meta_value ); 101 $this->assertEquals( $meta_value, bp_activity_get_meta( $a, 'linebreak_test' ) ); 102 } 89 103 } -
trunk/tests/testcases/groups/functions.php
r7182 r7469 270 270 $this->assertEquals( 1, groups_get_groupmeta( $g, 'total_member_count' ) ); 271 271 } 272 273 /** 274 * @group groupmeta 275 * @ticket BP5180 276 */ 277 public function test_groups_update_groupmeta_with_line_breaks() { 278 $g = $this->factory->group->create(); 279 $meta_value = 'Foo! 280 281 Bar!'; 282 groups_update_groupmeta( $g, 'linebreak_test', $meta_value ); 283 284 $this->assertEquals( $meta_value, groups_get_groupmeta( $g, 'linebreak_test' ) ); 285 } 272 286 } -
trunk/tests/testcases/xprofile/functions.php
r7365 r7469 63 63 $this->set_current_user( $old_current_user ); 64 64 } 65 66 /** 67 * @group bp_xprofile_update_meta 68 * @ticket BP5180 69 */ 70 public function test_bp_xprofile_update_meta_with_line_breaks() { 71 $g = $this->factory->xprofile_group->create(); 72 $f = $this->factory->xprofile_field->create( array( 73 'field_group_id' => $g->id, 74 'type' => 'textbox', 75 ) ); 76 77 $meta_value = 'Foo! 78 79 Bar!'; 80 bp_xprofile_update_meta( $f->id, 'field', 'linebreak_field', $meta_value ); 81 $this->assertEquals( $meta_value, bp_xprofile_get_meta( $f->id, 'field', 'linebreak_field' ) ); 82 } 65 83 }
Note: See TracChangeset
for help on using the changeset viewer.