Merge pull request #23006 from woocommerce/fix/phpcs-error

Fix error introduced by commit be05eea5da
This commit is contained in:
Mike Jolley 2019-03-13 10:59:17 +00:00 committed by GitHub
commit 2c14a8ddfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1531,7 +1531,9 @@ class WC_AJAX {
public static function json_search_products( $term = '', $include_variations = false ) {
check_ajax_referer( 'search-products', 'security' );
$term = isset( $_GET['term'] ) ? (string) wc_clean( wp_unslash( $_GET['term'] ) ) : '';
if ( empty( $term ) && isset( $_GET['term'] ) ) {
$term = (string) wc_clean( wp_unslash( $_GET['term'] ) );
}
if ( empty( $term ) ) {
wp_die();