| @@ 382-391 (lines=10) @@ | ||
| 379 | } |
|
| 380 | ||
| 381 | // Check whether we tried the host before |
|
| 382 | if (isset($this->slow_hosts[$urlParts['host']])) { |
|
| 383 | return array( |
|
| 384 | false, |
|
| 385 | $redirectCount, |
|
| 386 | sprintf( |
|
| 387 | $PMF_LANG['ad_linkcheck_openurl_tooslow'], |
|
| 388 | PMF_String::htmlspecialchars($urlParts['host']) |
|
| 389 | ) |
|
| 390 | ); |
|
| 391 | } |
|
| 392 | ||
| 393 | // Check whether the hostname exists |
|
| 394 | if (gethostbynamel($urlParts['host']) === false) { |
|
| @@ 415-426 (lines=12) @@ | ||
| 412 | $_host = 'ssl://'.$_host; |
|
| 413 | } |
|
| 414 | $fp = @fsockopen($_host, $urlParts['port'], $errno, $errstr, self::LINKVERIFIER_CONNECT_TIMEOUT); |
|
| 415 | if (!$fp) { |
|
| 416 | // mark this host too slow to verify |
|
| 417 | $this->slow_hosts[$urlParts['host']] = true; |
|
| 418 | return array( |
|
| 419 | false, |
|
| 420 | $redirectCount, |
|
| 421 | sprintf( |
|
| 422 | $PMF_LANG['ad_linkcheck_openurl_tooslow'], |
|
| 423 | PMF_String::htmlspecialchars($urlParts['host']) |
|
| 424 | ) |
|
| 425 | ); |
|
| 426 | } |
|
| 427 | ||
| 428 | // wait for data with timeout (default: 10secs) |
|
| 429 | stream_set_timeout($fp, self::LINKVERIFIER_RESPONSE_TIMEOUT, 0); |
|