Skip to content

Commit cceea0c

Browse files
committed
Merge branch 'const-overwritten' into community
2 parents 0a6efea + f45b91d commit cceea0c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Net/URLChecker.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ private function getHTTPResponseCode($url)
6464
$ch = curl_init();
6565
curl_setopt($ch, CURLOPT_URL, $url);
6666
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
67+
// The PHP doc indicates that CURLOPT_CONNECTTIMEOUT_MS constant is added in cURL 7.16.2
68+
// available since PHP 5.2.3.
69+
if (!defined(CURLOPT_CONNECTTIMEOUT_MS)) {
70+
define('CURLOPT_CONNECTTIMEOUT_MS', 156); // default value for CURLOPT_CONNECTTIMEOUT_MS
71+
}
6772
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, self::CONNECT_TIMEOUT_MS);
68-
// There is a PHP bug in some versions which didn't define the constant.
69-
curl_setopt(
70-
$ch,
71-
156, // CURLOPT_CONNECTTIMEOUT_MS
72-
self::CONNECT_TIMEOUT_MS
73-
);
73+
7474
$code = null;
7575
try {
7676
curl_exec($ch);

0 commit comments

Comments
 (0)