PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Remote/Fetch.php +9 -0 4.0.64.0.8 View file →
@@ -256,8 +256,17 @@
256 256 private static function validate_url( $url, &$ips = array() ) {
257 257 $ips = array();
258 258 $validated_url = wp_http_validate_url( $url );
259 259 if ( false === $validated_url ) {
260 + // WordPress 7.1+ rejects non-public IP literals inside wp_http_validate_url()
261 + // itself; older cores let them through to our is_global_ip() check below. Keep
262 + // the distinct "unsafe destination" error on every core version so callers can
263 + // tell a policy block from a malformed URL.
264 + $scheme = strtolower( (string) wp_parse_url( $url, PHP_URL_SCHEME ) );
265 + $host = (string) wp_parse_url( $url, PHP_URL_HOST );
266 + if ( in_array( $scheme, array( 'http', 'https' ), true ) && filter_var( $host, FILTER_VALIDATE_IP ) && ! self::is_global_ip( $host ) ) {
267 + return new WP_Error( 'visualizer_unsafe_remote_url', 'The remote URL resolves to a non-public address.' );
268 + }
260 269 return new WP_Error( 'visualizer_invalid_remote_url', 'The remote URL is not allowed.' );
261 270 }
262 271
263 272 $host = strtolower( rtrim( (string) wp_parse_url( $validated_url, PHP_URL_HOST ), '.' ) );