In wp_ajax_ajax_tag_search()
, bail immediately if $_GET['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. git-svn-id: https://develop.svn.wordpress.org/trunk@30167 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e5ad640c52
commit
ce6a31c5fe
@ -103,17 +103,20 @@ function wp_ajax_fetch_list() {
|
|||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*/
|
*/
|
||||||
function wp_ajax_ajax_tag_search() {
|
function wp_ajax_ajax_tag_search() {
|
||||||
if ( isset( $_GET['tax'] ) ) {
|
if ( ! isset( $_GET['tax'] ) ) {
|
||||||
$taxonomy = sanitize_key( $_GET['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( $_GET['tax'] );
|
||||||
|
$tax = get_taxonomy( $taxonomy );
|
||||||
|
if ( ! $tax ) {
|
||||||
|
wp_die( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! current_user_can( $tax->cap->assign_terms ) ) {
|
||||||
|
wp_die( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
$s = wp_unslash( $_GET['q'] );
|
$s = wp_unslash( $_GET['q'] );
|
||||||
|
|
||||||
$comma = _x( ',', 'tag delimiter' );
|
$comma = _x( ',', 'tag delimiter' );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user