Skip to content

Commit

Permalink
Helper to check if any of the rules have a query parameter context
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jan 5, 2020
1 parent 7902d70 commit 8fd6cfc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/UriRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,19 @@ function( $rule ) {
}
);
}

/**
* Check if any of the rules demand query string matching.
*
* @return boolean
*/
public function has_rules_with_query_strings() {
foreach ( $this->rules as $rule ) {
if ( false !== strpos( $rule, '?' ) ) {
return true;
}
}

return false;
}
}

0 comments on commit 8fd6cfc

Please sign in to comment.