From b13da6ae73d23c3da18ff9d78c56a5476d2993c7 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Wed, 26 Oct 2016 02:29:30 +0000 Subject: [PATCH] REST API: Add missing sanitization callback for the `hide_empty` parameter of the Terms Controller. Fixes a bug where the boolean parameter `hide_empty` was not being properly sanitized in the Terms controller. Props websupporter. Fixes #38465. Built from https://develop.svn.wordpress.org/trunk@38942 git-svn-id: http://core.svn.wordpress.org/trunk@38885 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-terms-controller.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php index cf131adb67..6540c52fdf 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php @@ -867,6 +867,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { 'description' => __( 'Whether to hide resources not assigned to any posts.' ), 'type' => 'boolean', 'default' => false, + 'sanitize_callback' => 'rest_sanitize_request_arg', 'validate_callback' => 'rest_validate_request_arg', ); if ( $taxonomy->hierarchical ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index e8fa15cf3c..e3b07b7696 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38941'; +$wp_version = '4.7-alpha-38942'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.