← All changes
|
jetpack_vendor/automattic/jetpack-status/src/class-status.php
+9
-2
16.2-beta
→
16.3-beta
View file →
| @@ -162,9 +162,14 @@ | ||
| 162 | 162 | */ |
| 163 | 163 | $host = ''; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - // Check for localhost and sites using an IP only first. | |
| 166 | + /* | |
| 167 | + * Check for localhost and sites using an IP only first. No dot means it can't be a | |
| 168 | + * public domain. Dotless IPv6 literals land here too, routable ones included: | |
| 169 | + * WordPress.com won't register an IPv6 site URL, so offline mode is where they belong. | |
| 170 | + * An IPv4-mapped literal like [::ffff:127.0.0.1] keeps its dots and reads as remote. | |
| 171 | + */ | |
| 167 | 172 | $is_local = '' !== $host && false === strpos( $host, '.' ); |
| 168 | 173 | |
| 169 | 174 | // Use Core's environment check, if available. |
| 170 | 175 | if ( 'local' === wp_get_environment_type() ) { |
| @@ -180,9 +185,11 @@ | ||
| 180 | 185 | '#\.docksal\.site$#i', // Docksal. |
| 181 | 186 | '#\.dev\.cc$#i', // ServerPress. |
| 182 | 187 | '#\.lndo\.site$#i', // Lando. |
| 183 | 188 | '#\.ddev\.site$#i', // DDEV. |
| 184 | - '#^127\.0\.0\.1$#', | |
| 189 | + // The whole 127.0.0.0/8 range is loopback; each octet is capped at 255. | |
| 190 | + '#^127\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){2}$#', | |
| 191 | + '#^0\.0\.0\.0$#', // All-interfaces bind, common under Docker and `wp server`. | |
| 185 | 192 | '#^playground\.wordpress\.net$#i', // WordPress Playground, which runs entirely in the browser. |
| 186 | 193 | ); |
| 187 | 194 | |
| 188 | 195 | if ( ! $is_local && '' !== $host ) { |