Piwik\UrlHelper::in_array_matches_regex PHP Метод

in_array_matches_regex() защищенный статический Метод

Checks if a string matches/is equal to one of the patterns/strings.
protected static in_array_matches_regex ( $test, $patterns ) : true
$test String to test.
$patterns Array of strings or regexs.
Результат true if $test matches or is equal to one of the regex/string in $patterns, false otherwise.
    protected static function in_array_matches_regex($test, $patterns)
    {
        foreach ($patterns as $val) {
            if (@preg_match($val, null) === false) {
                if (strcasecmp($val, $test) === 0) {
                    return true;
                }
            } else {
                if (preg_match($val, $test) === 1) {
                    return true;
                }
            }
        }
        return false;
    }