From d06347f10ef20989f1fe705b7692c23a4ebe00dc Mon Sep 17 00:00:00 2001 From: toniperic Date: Thu, 27 Apr 2017 10:13:47 +0200 Subject: [PATCH] Correct constant checking Prior to this change I would be getting `Constant CURLOPT_CONNECTTIMEOUT_MS already defined` since PHP would try to re-define a constant. --- lib/Net/URLChecker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/URLChecker.php b/lib/Net/URLChecker.php index 575daac56..00ad62593 100644 --- a/lib/Net/URLChecker.php +++ b/lib/Net/URLChecker.php @@ -66,7 +66,7 @@ private function getHTTPResponseCode($url) curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // The PHP doc indicates that CURLOPT_CONNECTTIMEOUT_MS constant is added in cURL 7.16.2 // available since PHP 5.2.3. - if (!defined(CURLOPT_CONNECTTIMEOUT_MS)) { + if (!defined('CURLOPT_CONNECTTIMEOUT_MS')) { define('CURLOPT_CONNECTTIMEOUT_MS', 156); // default value for CURLOPT_CONNECTTIMEOUT_MS } curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, self::CONNECT_TIMEOUT_MS);