| @@ 274-290 (lines=17) @@ | ||
| 271 | * |
|
| 272 | * @return bool |
|
| 273 | */ |
|
| 274 | protected function _set_platform() |
|
| 275 | { |
|
| 276 | if (is_array($this->platforms) && count($this->platforms) > 0) |
|
| 277 | { |
|
| 278 | foreach ($this->platforms as $key => $val) |
|
| 279 | { |
|
| 280 | if (preg_match('|'.preg_quote($key).'|i', $this->agent)) |
|
| 281 | { |
|
| 282 | $this->platform = $val; |
|
| 283 | return TRUE; |
|
| 284 | } |
|
| 285 | } |
|
| 286 | } |
|
| 287 | ||
| 288 | $this->platform = 'Unknown Platform'; |
|
| 289 | return FALSE; |
|
| 290 | } |
|
| 291 | ||
| 292 | // -------------------------------------------------------------------- |
|
| 293 | ||
| @@ 326-343 (lines=18) @@ | ||
| 323 | * |
|
| 324 | * @return bool |
|
| 325 | */ |
|
| 326 | protected function _set_robot() |
|
| 327 | { |
|
| 328 | if (is_array($this->robots) && count($this->robots) > 0) |
|
| 329 | { |
|
| 330 | foreach ($this->robots as $key => $val) |
|
| 331 | { |
|
| 332 | if (preg_match('|'.preg_quote($key).'|i', $this->agent)) |
|
| 333 | { |
|
| 334 | $this->is_robot = TRUE; |
|
| 335 | $this->robot = $val; |
|
| 336 | $this->_set_mobile(); |
|
| 337 | return TRUE; |
|
| 338 | } |
|
| 339 | } |
|
| 340 | } |
|
| 341 | ||
| 342 | return FALSE; |
|
| 343 | } |
|
| 344 | ||
| 345 | // -------------------------------------------------------------------- |
|
| 346 | ||