Skip to content

Commit

Permalink
Use empty() instead of is_null() when checking $wp_query to cover mor…
Browse files Browse the repository at this point in the history
…e possible edge cases
  • Loading branch information
cmmarslender committed Jun 18, 2014
1 parent 183e5ea commit 66f4bae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions safe-redirect-manager.php
Expand Up @@ -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;
Expand All @@ -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';
Expand All @@ -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' );
Expand Down

0 comments on commit 66f4bae

Please sign in to comment.