Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use empty() instead of is_null() when checking $wp_query to cover mor…

…e possible edge cases
  • Loading branch information...
commit 66f4bae0ed1ebf5a95c44a71971ed6358d476264 1 parent 183e5ea
Chris Marslender cmmarslender authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 safe-redirect-manager.php
6 safe-redirect-manager.php
View
@@ -109,7 +109,7 @@ public function action_init_load_textdomain() {
public function filter_search_join( $join ) {
global $wp_query;
- if ( is_null( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) )
+ if ( empty( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) )
return $join;
global $wpdb;
@@ -132,7 +132,7 @@ public function filter_search_join( $join ) {
public function filter_search_distinct( $distinct ) {
global $wp_query;
- if ( is_null( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) )
+ if ( empty( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) )
return $distinct;
return 'DISTINCT';
@@ -149,7 +149,7 @@ public function filter_search_distinct( $distinct ) {
public function filter_search_where( $where ) {
global $wp_query;
- if ( is_null( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) || ! is_search() || empty( $where ) )
+ if ( empty( $wp_query ) || $this->redirect_post_type != get_query_var( 'post_type' ) || ! is_search() || empty( $where ) )
return $where;
$exact = get_query_var( 'exact' );
Please sign in to comment.
Something went wrong with that request. Please try again.