Skip to content

Commit

Permalink
If an invalid kind is passed in, reset it to default. (#4616)
Browse files Browse the repository at this point in the history
  • Loading branch information
George Stephanis authored and samhotchkiss committed Aug 19, 2016
1 parent 793ecee commit c9df4ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions class.jetpack-user-agent.php
Expand Up @@ -15,6 +15,11 @@ function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
static $first_run = true;
static $matched_agent = '';

// If an invalid kind is passed in, reset it to default.
if ( ! isset( $kinds[ $kind ] ) ) {
$kind = 'any';
}

if ( function_exists( 'apply_filters' ) ) {
/**
* Filter the value of jetpack_is_mobile before it is calculated.
Expand Down

0 comments on commit c9df4ec

Please sign in to comment.