mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-12 06:43:20 +01:00
In wp_ajax_get_tagcloud()
, bail immediately if $_POST['tax']
isn't set so that all of the variable setting can happen in the same nest scope as the rest of the function - wp_die()
confuses Scrutinizer.
See #30224. Built from https://develop.svn.wordpress.org/trunk@30168 git-svn-id: http://core.svn.wordpress.org/trunk@30168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a786fb779c
commit
6a109700d0
@ -819,17 +819,20 @@ function wp_ajax_add_tag() {
|
|||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*/
|
*/
|
||||||
function wp_ajax_get_tagcloud() {
|
function wp_ajax_get_tagcloud() {
|
||||||
if ( isset( $_POST['tax'] ) ) {
|
if ( ! isset( $_POST['tax'] ) ) {
|
||||||
$taxonomy = sanitize_key( $_POST['tax'] );
|
|
||||||
$tax = get_taxonomy( $taxonomy );
|
|
||||||
if ( ! $tax )
|
|
||||||
wp_die( 0 );
|
|
||||||
if ( ! current_user_can( $tax->cap->assign_terms ) )
|
|
||||||
wp_die( -1 );
|
|
||||||
} else {
|
|
||||||
wp_die( 0 );
|
wp_die( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$taxonomy = sanitize_key( $_POST['tax'] );
|
||||||
|
$tax = get_taxonomy( $taxonomy );
|
||||||
|
if ( ! $tax ) {
|
||||||
|
wp_die( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! current_user_can( $tax->cap->assign_terms ) ) {
|
||||||
|
wp_die( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
$tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
|
$tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
|
||||||
|
|
||||||
if ( empty( $tags ) )
|
if ( empty( $tags ) )
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-alpha-30167';
|
$wp_version = '4.1-alpha-30168';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user