WordPress.org

Make WordPress Core

Ticket #46791: 46791.diff

File 46791.diff, 633 bytes (added by subrataemfluence, 19 months ago)

Proposed patch.

  • wp-includes/formatting.php

    diff --git wp-includes/formatting.php wp-includes/formatting.php
    index 835862c..6828a12 100755
    function esc_url( $url, $protocols = null, $_context = 'display' ) { 
    41924192         * presume it needs http:// prepended (unless a relative
    41934193         * 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        }