[wp-trac] [WordPress Trac] #23187: esc_url() fails if the URL's scheme's case does not match the allowed protocol's case
WordPress Trac
noreply at wordpress.org
Sat Jan 12 05:51:40 UTC 2013
#23187: esc_url() fails if the URL's scheme's case does not match the allowed
protocol's case
-----------------------------+--------------------------
Reporter: mdawaffe | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: | Severity: normal
Keywords: |
-----------------------------+--------------------------
Steps to reproduce:
{{{
$url = esc_url( 'HTTP://example.com' );
var_dump( $url );
}}}
Expected output:
{{{
string(18) "http://example.com"
}}}
Actual output:
{{{
string(0) ""
}}}
From http://tools.ietf.org/html/rfc3986:
> Although schemes are case-insensitive, the canonical form is lowercase
and documents that specify schemes must do so with lowercase letters. An
implementation should accept uppercase letters as equivalent to lowercase
in scheme names (e.g., allow "HTTP" as well as "http") for the sake of
robustness but should only produce lowercase scheme names for consistency.
Patch and unit tests attached.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23187>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list