Changeset 40290
- Timestamp:
- 03/14/2017 06:41:26 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r40275 r40290 1917 1917 1918 1918 $object_ids = implode( ',', $object_ids ); 1919 $taxonomies = implode( ',', $taxonomies );1919 $taxonomies = "'" . implode( "', '", array_map( 'esc_sql', $taxonomies ) ) . "'"; 1920 1920 1921 1921 /** -
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r39578 r40290 86 86 } 87 87 88 /** 89 * @ticket 40154 90 */ 91 public function test_taxonomies_passed_to_wp_get_object_terms_filter_should_be_quoted() { 92 register_taxonomy( 'wptests_tax', 'post' ); 93 register_taxonomy( 'wptests_tax_2', 'post' ); 94 95 add_filter( 'wp_get_object_terms', array( $this, 'wp_get_object_terms_callback' ), 10, 3 ); 96 $terms = wp_get_object_terms( 1, array( 'wptests_tax', 'wptests_tax_2' ) ); 97 remove_filter( 'wp_get_object_terms', array( $this, 'wp_get_object_terms_callback' ), 10, 3 ); 98 99 $this->assertSame( "'wptests_tax', 'wptests_tax_2'", $this->taxonomies ); 100 } 101 102 public function wp_get_object_terms_callback( $terms, $object_ids, $taxonomies ) { 103 $this->taxonomies = $taxonomies; 104 return $terms; 105 } 106 88 107 public function test_orderby_name() { 89 108 $p = self::factory()->post->create();
Note: See TracChangeset
for help on using the changeset viewer.