WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 21 months ago

#18260 closed defect (bug) (fixed)

Don't prepend scheme to urls staring with a question mark in esc_url()

Reported by: ryan Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Formatting Keywords:
Focuses: Cc:

Description

The scheme is not prepended for other relative urls. It should not be prepended here either.

Attachments (2)

18260.diff (860 bytes) - added by ryan 4 years ago.
18260.2.diff (849 bytes) - added by ryan 4 years ago.
in_array()

Download all attachments as: .zip

Change History (7)

@ryan4 years ago

comment:1 @nacin4 years ago

Looks good. Code wise, another option: ! in_array( $url[0], array( '/', '#', '?' ) ).

Not sure if the in_array() will be faster, but array access should be faster than substr, especially if limited to one time.

@ryan4 years ago

in_array()

comment:2 @ryan4 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [18469]:

Recognize urls that start with a question mark as relative urls that do not require a scheme to be prepended. fixes #18260

comment:4 @downloadbook4 years ago

download free ebook for computer

Version 0, edited 4 years ago by downloadbook (next)

comment:5 @SergeyBiryukov21 months ago

#16945 was marked as a duplicate.

Note: See TracTickets for help on using tickets.