Make WordPress Core

Ticket #35631: 35631.diff

File 35631.diff, 772 bytes (added by kjbenk, 9 years ago)

This does not sound like a major issue but here is a patch to check for each part of the URL that is needed. If the URL is not valid it will tell the user.

  • wp-admin/network/site-info.php

    diff --git a/wp-admin/network/site-info.php b/wp-admin/network/site-info.php
    index 50f287d..ecb0945 100644
    a b if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) { 
    7878                }
    7979                $update_parsed_url = parse_url( $blog_data['url'] );
    8080
     81                // Check if the URL is valid
     82
     83                if ( ! isset( $update_parsed_url['scheme'] ) || ! isset( $update_parsed_url['host'] ) || ! isset( $update_parsed_url['path'] ) ) {
     84                        wp_die( __( sprintf( 'The provided Site URL: %s is not valid.' , $blog_data['url'] ) ) );
     85                }
     86
    8187                $blog_data['scheme'] = $update_parsed_url['scheme'];
    8288                $blog_data['domain'] = $update_parsed_url['host'];
    8389                $blog_data['path'] = $update_parsed_url['path'];