From d5bc0fe493eb9f931597a36cebde79537cec3dc8 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 15 Jan 2016 19:35:26 +0000 Subject: [PATCH] Populate term cache with proper clone of term objects. [34999] modified the cache strategy for terms in the context of `wp_get_object_terms()`. As part of these changes, the `object_id` property of term objects had to be unset before being cached. To avoid modifying passed-by- reference terms, `update_term_cache()` attempted to make a copy of the terms passed to the function; however, it failed to use the `clone` keyword, and thus only created a reference instead of a copy. Props berengerzyla. Fixes #35462. Built from https://develop.svn.wordpress.org/trunk@36323 git-svn-id: http://core.svn.wordpress.org/trunk@36290 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 5f5127ac10..1f51ff9cd2 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -3721,7 +3721,7 @@ function update_object_term_cache($object_ids, $object_type) { function update_term_cache( $terms, $taxonomy = '' ) { foreach ( (array) $terms as $term ) { // Create a copy in case the array was passed by reference. - $_term = $term; + $_term = clone $term; // Object ID should not be cached. unset( $_term->object_id ); diff --git a/wp-includes/version.php b/wp-includes/version.php index fca11a8c78..060c58c050 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-1452886392909'; +$wp_version = '4.5-alpha-1452886512627'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.