Changeset 25446
- Timestamp:
- 09/14/2013 11:09:59 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r25445 r25446 2042 2042 2043 2043 if ( isset( $args['archived'] ) ) 2044 $query .= $wpdb->prepare( "AND archived = % d ", $args['archived'] );2044 $query .= $wpdb->prepare( "AND archived = %s ", (int) $args['archived'] ); // ENUM field 2045 2045 2046 2046 if ( isset( $args['mature'] ) ) -
trunk/tests/phpunit/tests/ms.php
r25445 r25446 1069 1069 } 1070 1070 1071 /** 1072 * Test the 'archived' argument for wp_get_sites(). 1073 * 1074 * archived is an ENUM, not an integer field. 1075 * ENUM('0', '1') means '0' is index 1 and '1' is index 2. 1076 * `WHERE archived = 1` is like saying `WHERE archived = '0'`. 1077 * `WHERE archived = 0` would produce no results. 1078 * 1079 * @ticket 14511 1080 */ 1081 function test_wp_get_sites_archived_enum() { 1082 global $wpdb; 1083 $id = $this->factory->blog->create( array( 'site_id' => 2, 'meta' => array( 'archived' => '1' ) ) ); 1084 $this->factory->blog->create( array( 'site_id' => 2, 'meta' => array( 'archived' => '0' ) ) ); 1085 $results = wp_get_sites( array( 'network_id' => 2, 'archived' => 1 ) ); 1086 $this->assertCount( 1, $results ); 1087 $this->assertEquals( $id, $results[0]['blog_id'], "This query is wrong:\n" . $wpdb->last_query ); 1088 } 1071 1089 } 1072 1090
Note: See TracChangeset
for help on using the changeset viewer.