WordPress.org

Make WordPress Core

Ticket #46791: 46791-2.diff

File 46791-2.diff, 782 bytes (added by subrataemfluence, 10 months ago)

Corrected patch.

  • wp-includes/formatting.php

    diff --git wp-includes/formatting.php wp-includes/formatting.php
    index 835862c..3ab3f6b 100755
    function esc_url( $url, $protocols = null, $_context = 'display' ) { 
    41904190        $url = str_replace( ';//', '://', $url );
    41914191        /* If the URL doesn't appear to contain a scheme, we
    41924192         * presume it needs http:// prepended (unless a relative
    4193          * link starting with /, # or ? or a php file).
     4193         * link starting with ., /, # or ? or a php file).
    41944194         */
    4195         if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
     4195        if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '.', '/', '#', '?' ) ) &&
    41964196                ! preg_match( '/^[a-z0-9-]+?\.php/i', $url ) ) {
    41974197                $url = 'http://' . $url;
    41984198        }