Opened 2 years ago

Last modified 2 years ago

#16945 new enhancement

Add relative URIs containing a query in esc_url()

Reported by: hakre Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.1
Severity: normal Keywords: has-patch
Cc:

Description

I'd like to enhance the esc_url function to accept an url starting with ? (query) to not require a protocol.

That's comparable with the # (fragment) case we already have in.

This is useful to create links to the current page that need a query only. Otherwise the php file must be added and for frontend pages it won't work with pretty permalinks.

Attachments (1)

16945.patch (874 bytes) - added by hakre 2 years ago.
First approach

Download all attachments as: .zip

Change History (2)

hakre2 years ago

First approach

Related: (In [11126]) Don't prepend http to fragments. Props scohoust. fixes #4051

Note: See TracTickets for help on using tickets.