|
@@ 42-56 (lines=15) @@
|
| 39 |
|
return ! $this->nofollow($userAgent); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public function noindex(string $userAgent = '*'): bool |
| 43 |
|
{ |
| 44 |
|
$userAgent = strtolower($userAgent); |
| 45 |
|
|
| 46 |
|
if (isset($this->robotHeadersProperties[$userAgent]) |
| 47 |
|
&& isset($this->robotHeadersProperties[$userAgent]['noindex'])) { |
| 48 |
|
return $this->robotHeadersProperties[$userAgent]['noindex']; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
if ($wildCard = $this->checkForWildcard($userAgent, 'noindex') !== null) { |
| 52 |
|
return $wildCard; |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
return $this->robotHeadersProperties['*']['noindex'] ?? false; |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function nofollow(string $userAgent = '*'): bool |
| 59 |
|
{ |
|
@@ 58-75 (lines=18) @@
|
| 55 |
|
return $this->robotHeadersProperties['*']['noindex'] ?? false; |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function nofollow(string $userAgent = '*'): bool |
| 59 |
|
{ |
| 60 |
|
$userAgent = strtolower($userAgent); |
| 61 |
|
|
| 62 |
|
// check for exact |
| 63 |
|
if (isset($this->robotHeadersProperties[$userAgent]) |
| 64 |
|
&& isset($this->robotHeadersProperties[$userAgent]['nofollow'])) { |
| 65 |
|
return $this->robotHeadersProperties[$userAgent]['nofollow']; |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
// check for wildcrad user agent |
| 69 |
|
if ($wildCard = $this->checkForWildcard($userAgent, 'nofollow') !== null) { |
| 70 |
|
return $wildCard; |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
// check for wildcrad |
| 74 |
|
return $this->robotHeadersProperties['*']['nofollow'] ?? false; |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
protected function checkForWildcard(string $userAgent, string $property) |
| 78 |
|
{ |