Skip to content

Commit 34912a2

Browse files
jehervematticbot
authored andcommitted
Surpress dns_get_record() warning for localhost (#41994)
* Surpress dns_get_record() warning for localhost When on localhost the dns_get_record() call generates a PHP warning ("DNS Query failed"). Prefix call with @ to supress this warning. * Remove suppressed warning and check for output instead See discussion in Automattic/jetpack#41994 (review) * Add changelog --------- Co-authored-by: Jeremy Herve <jeremy@jeremy.hu> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13528472600 Upstream-Ref: Automattic/jetpack@15a5f0b
1 parent 75e31d1 commit 34912a2

File tree

15 files changed

+100
-88
lines changed

15 files changed

+100
-88
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"automattic/jetpack-my-jetpack": "^5.5.1-alpha",
1212
"automattic/jetpack-search": "^0.47.12",
1313
"automattic/jetpack-stats": "^0.15.2",
14-
"automattic/jetpack-status": "^5.0.4",
14+
"automattic/jetpack-status": "^5.0.5-alpha",
1515
"automattic/jetpack-sync": "^4.8.2"
1616
},
1717
"require-dev": {

jetpack_vendor/automattic/jetpack-connection/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"automattic/jetpack-assets": "^4.0.8",
1111
"automattic/jetpack-constants": "^3.0.2",
1212
"automattic/jetpack-roles": "^3.0.2",
13-
"automattic/jetpack-status": "^5.0.4",
13+
"automattic/jetpack-status": "^5.0.5-alpha",
1414
"automattic/jetpack-redirect": "^3.0.2"
1515
},
1616
"require-dev": {

jetpack_vendor/automattic/jetpack-jitm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"automattic/jetpack-device-detection": "^3.0.1",
1212
"automattic/jetpack-logo": "^3.0.1",
1313
"automattic/jetpack-redirect": "^3.0.2",
14-
"automattic/jetpack-status": "^5.0.4"
14+
"automattic/jetpack-status": "^5.0.5-alpha"
1515
},
1616
"require-dev": {
1717
"brain/monkey": "^2.6.2",

jetpack_vendor/automattic/jetpack-my-jetpack/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"automattic/jetpack-redirect": "^3.0.2",
1717
"automattic/jetpack-constants": "^3.0.2",
1818
"automattic/jetpack-plans": "^0.5.3",
19-
"automattic/jetpack-status": "^5.0.4",
19+
"automattic/jetpack-status": "^5.0.5-alpha",
2020
"automattic/jetpack-sync": "^4.8.2",
2121
"automattic/jetpack-protect-status": "^0.5.2"
2222
},

jetpack_vendor/automattic/jetpack-plugins-installer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"require": {
77
"php": ">=7.2",
88
"automattic/jetpack-a8c-mc-stats": "^3.0.1",
9-
"automattic/jetpack-status": "^5.0.4"
9+
"automattic/jetpack-status": "^5.0.5-alpha"
1010
},
1111
"require-dev": {
1212
"yoast/phpunit-polyfills": "^1.1.1",

jetpack_vendor/automattic/jetpack-redirect/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPL-2.0-or-later",
66
"require": {
77
"php": ">=7.2",
8-
"automattic/jetpack-status": "^5.0.4"
8+
"automattic/jetpack-status": "^5.0.5-alpha"
99
},
1010
"require-dev": {
1111
"brain/monkey": "^2.6.2",

jetpack_vendor/automattic/jetpack-search/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"automattic/jetpack-connection": "^6.6.0",
99
"automattic/jetpack-assets": "^4.0.8",
1010
"automattic/jetpack-constants": "^3.0.2",
11-
"automattic/jetpack-status": "^5.0.4",
11+
"automattic/jetpack-status": "^5.0.5-alpha",
1212
"automattic/jetpack-config": "^3.0.1",
1313
"automattic/jetpack-my-jetpack": "^5.5.1-alpha",
1414
"automattic/jetpack-sync": "^4.8.2"

jetpack_vendor/automattic/jetpack-stats/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"php": ">=7.2",
88
"automattic/jetpack-connection": "^6.6.0",
99
"automattic/jetpack-constants": "^3.0.2",
10-
"automattic/jetpack-status": "^5.0.4"
10+
"automattic/jetpack-status": "^5.0.5-alpha"
1111
},
1212
"require-dev": {
1313
"yoast/phpunit-polyfills": "^1.1.1",

jetpack_vendor/automattic/jetpack-status/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [5.0.5-alpha] - unreleased
9+
10+
This is an alpha version! The changes listed here are not final.
11+
12+
### Fixed
13+
- Hosting provider checks: avoid PHP warnings in local environments.
14+
815
## [5.0.4] - 2025-02-24
916
### Changed
1017
- Host detection: Look for specific external hosting provider only when required. [#41890]
@@ -425,6 +432,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
425432

426433
- Packages: Introduce a status package
427434

435+
[5.0.5-alpha]: https://github.com/Automattic/jetpack-status/compare/v5.0.4...v5.0.5-alpha
428436
[5.0.4]: https://github.com/Automattic/jetpack-status/compare/v5.0.3...v5.0.4
429437
[5.0.3]: https://github.com/Automattic/jetpack-status/compare/v5.0.2...v5.0.3
430438
[5.0.2]: https://github.com/Automattic/jetpack-status/compare/v5.0.1...v5.0.2

jetpack_vendor/automattic/jetpack-status/src/class-host.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public function get_nameserver_dns_records( $domain ) {
147147
}
148148

149149
$dns_records = dns_get_record( $domain, DNS_NS ); // Fetches the DNS records of type NS (Name Server)
150+
if ( false === $dns_records ) {
151+
return array();
152+
}
153+
150154
$nameservers = array();
151155
foreach ( $dns_records as $record ) {
152156
if ( isset( $record['target'] ) ) {

0 commit comments

Comments
 (0)