diff --git c/src/wp-includes/formatting.php w/src/wp-includes/formatting.php
index 80e1545caf..b908aa3a92 100644
c
|
w
|
function is_email( $email, $deprecated = false ) { |
2948 | 2948 | } |
2949 | 2949 | |
2950 | 2950 | /** |
| 2951 | * Verifies that an URL is valid wordpress one. |
| 2952 | * |
| 2953 | * @since 0.71 |
| 2954 | * |
| 2955 | * @param string $url URL to verify |
| 2956 | * @return string|bool Either false or the valid url. |
| 2957 | */ |
| 2958 | function is_wordpress_url( $url ) { |
| 2959 | $parsed = parse_url($url, PHP_URL_SCHEME); |
| 2960 | if (false === $parsed) { |
| 2961 | return apply_filters( 'is_wordpress_url', false, $url, 'invalid_url' ); |
| 2962 | } |
| 2963 | |
| 2964 | if (null === $parsed || ($parsed !== 'http' && $parsed !== 'https')) { |
| 2965 | return apply_filters( 'is_wordpress_url', false, $url, 'invalid_scheme' ); |
| 2966 | } |
| 2967 | |
| 2968 | return apply_filters( 'is_wordpress_url', $url, $url, null ); |
| 2969 | } |
| 2970 | |
| 2971 | /** |
2951 | 2972 | * Convert to ASCII from email subjects. |
2952 | 2973 | * |
2953 | 2974 | * @since 1.2.0 |
… |
… |
function sanitize_option( $option, $value ) { |
4159 | 4180 | if ( is_wp_error( $value ) ) { |
4160 | 4181 | $error = $value->get_error_message(); |
4161 | 4182 | } else { |
4162 | | if ( preg_match( '#http(s?)://(.+)#i', $value ) ) { |
| 4183 | if ( is_wordpress_url($value) ) { |
4163 | 4184 | $value = esc_url_raw( $value ); |
4164 | 4185 | } else { |
4165 | 4186 | $error = __( 'The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.' ); |
… |
… |
function sanitize_option( $option, $value ) { |
4172 | 4193 | if ( is_wp_error( $value ) ) { |
4173 | 4194 | $error = $value->get_error_message(); |
4174 | 4195 | } else { |
4175 | | if ( preg_match( '#http(s?)://(.+)#i', $value ) ) { |
| 4196 | if ( is_wordpress_url($value) ) { |
4176 | 4197 | $value = esc_url_raw( $value ); |
4177 | 4198 | } else { |
4178 | 4199 | $error = __( 'The Site address you entered did not appear to be a valid URL. Please enter a valid URL.' ); |