| 1 | <?php |
||
| 11 | class CleanParamClient implements ClientInterface |
||
| 12 | { |
||
| 13 | use DirectiveParserCommons; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Clean-param |
||
| 17 | * @var string[][] |
||
| 18 | */ |
||
| 19 | private $cleanParam = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * CleanParamClient constructor. |
||
| 23 | * |
||
| 24 | * @param string[][] $cleanParam |
||
| 25 | */ |
||
| 26 | public function __construct(array $cleanParam) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Check |
||
| 33 | * |
||
| 34 | * @param string $url |
||
| 35 | * @return bool |
||
| 36 | */ |
||
| 37 | public function isListed($url) |
||
| 38 | { |
||
| 39 | foreach ($this->cleanParam as $param => $paths) { |
||
| 40 | if ( |
||
| 41 | ( |
||
| 42 | mb_stripos($url, "?$param=") || |
||
| 43 | mb_stripos($url, "&$param=") |
||
| 44 | ) && |
||
| 45 | $this->checkPaths($url, $paths) |
||
| 46 | ) { |
||
| 47 | return true; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | return false; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Export |
||
| 55 | * |
||
| 56 | * @return string[][] |
||
| 57 | */ |
||
| 58 | public function export() |
||
| 62 | } |
||
| 63 |