Conditions | 6 |
Paths | 10 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | private function match($domain, $url) |
||
48 | { |
||
49 | $count = substr_count($domain, '*'); |
||
50 | foreach (explode('*', $domain) as $e) |
||
51 | { |
||
52 | if (empty($e)) |
||
53 | continue; |
||
54 | |||
55 | if (strpos($url, $e) === false) |
||
56 | return false; |
||
57 | $url = str_replace($e, '@', $url); |
||
58 | } |
||
59 | |||
60 | $params = []; |
||
61 | foreach (explode('@', $url) as $t) |
||
62 | { |
||
63 | if (!empty($t)) |
||
64 | $params[] = $t; |
||
65 | } |
||
66 | |||
67 | return ($count === count($params)); |
||
68 | } |
||
69 | |||
71 |