Merge pull request #13303 from MrPetovan/bug/warnings

Remove useless call to gethostbyname()
pull/13309/head
Philipp 2023-07-25 20:13:16 +02:00 zatwierdzone przez GitHub
commit 51b128c678
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -73,7 +73,7 @@ class HttpClient implements ICanSendHttpRequests
throw new \InvalidArgumentException('Unable to retrieve the host in URL: ' . $url); throw new \InvalidArgumentException('Unable to retrieve the host in URL: ' . $url);
} }
if(!filter_var($host, FILTER_VALIDATE_IP) && !@dns_get_record($host . '.', DNS_A + DNS_AAAA) && !gethostbyname($host)) { if(!filter_var($host, FILTER_VALIDATE_IP) && !@dns_get_record($host . '.', DNS_A + DNS_AAAA)) {
$this->logger->debug('URL cannot be resolved.', ['url' => $url, 'callstack' => System::callstack(20)]); $this->logger->debug('URL cannot be resolved.', ['url' => $url, 'callstack' => System::callstack(20)]);
$this->profiler->stopRecording(); $this->profiler->stopRecording();
return CurlResult::createErrorCurl($this->logger, $url); return CurlResult::createErrorCurl($this->logger, $url);