Changeset 10778
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r10740 r10778 238 238 $field = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) ); 239 239 240 wp_cache_add( $field->id, $field, 'bp_xprofile_fields' );241 242 240 if ( ! $field ) { 243 241 return false; 244 242 } 243 244 wp_cache_add( $field->id, $field, 'bp_xprofile_fields' ); 245 245 } 246 246 -
trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-field.php
r10164 r10778 175 175 $this->assertSame( $num_queries, $wpdb->num_queries ); 176 176 } 177 178 /** 179 * @ticket BP7073 180 */ 181 public function test_bad_field_id_should_not_be_cached() { 182 BP_XProfile_Field::get_instance( 12345 ); 183 184 $this->assertFalse( wp_cache_get( 12345, 'bp_xprofile_fields' ) ); 185 } 177 186 }
Note: See TracChangeset
for help on using the changeset viewer.