File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,7 @@ class DNSGetRecordWrapper
1212 */
1313 public function getRecords (string $ host , int $ type ): DNSRecords
1414 {
15- // A workaround to fix https://bugs.php.net/bug.php?id=73149
16- set_error_handler (
17- static function (int $ errorLevel , string $ errorMessage ): never {
18- throw new \RuntimeException ("Unable to get DNS record for the host: $ errorMessage " );
19- }
20- );
21- try {
22- // Get all MX, A and AAAA DNS records for host
23- return new DNSRecords (dns_get_record ($ host , $ type ));
24- } catch (\RuntimeException $ exception ) {
25- return new DNSRecords ([], true );
26- } finally {
27- restore_error_handler ();
28- }
15+ $ result = @dns_get_record ($ host , $ type );
16+ return new DNSRecords ($ result === false ? [] : $ result );
2917 }
3018}
You can’t perform that action at this time.
0 commit comments