WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37300 closed enhancement (fixed)

Add 'urn' to allowed protocols

Reported by: geekysoft Owned by: ocean90
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:
PR Number:

Description

'urn' should be the safest protocol to allow on the planet as it doesn’t do much, except act as an identifier in various XML schemes.

the_guid() currently uses esc_url() as a default filter, meaning urn:uuid:<hash> can’t be used as a guid in feeds ithout first allowing the urn protocol. The Atom feed standard shows most examples with a urn:uuid used as the ID. (IDs in Atom must be URIs so using esc_url() still makes perfect sense.)

The attach patch adds the urn protocol to the list of allowed protocols. (See RFC 2141 for details on the protocol schema.)

Work-around: print( get_the_guid() ); doesn’t apply any default filters like the_guid() does.

Attachments (4)

protocol.patch (667 bytes) - added by geekysoft 3 years ago.
protocol_2.patch (1.2 KB) - added by geekysoft 3 years ago.
protocol_3.patch (1.2 KB) - added by geekysoft 3 years ago.
37300.diff (1.3 KB) - added by jorbin 3 years ago.

Download all attachments as: .zip

Change History (10)

@geekysoft
3 years ago

#1 @ocean90
3 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement
  • Version trunk deleted

@geekysoft Thanks for the ticket and the patch, looks good to me. The function needs only a new changelog entry for the new protocol, see [32346] for 'webcal'.

#2 @geekysoft
3 years ago

@ocean90, I’m sorry for not responding earlier. This went into my Spam folder. Do you still need me revise the patch to include the changelog entry? What version number should I use?

#3 @SergeyBiryukov
3 years ago

  • Milestone changed from Future Release to 4.7

@jorbin
3 years ago

#4 @jorbin
3 years ago

Updated patch to be from the root.

@ocean90 Can you take a look?

#5 @ocean90
3 years ago

  • Owner set to ocean90
  • Status changed from new to reviewing

#6 @ocean90
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 38686:

Add 'urn' to the list of URI protocols whitelisted by default.

Props geekysoft, jorbin.
Fixes #37300.

Note: See TracTickets for help on using tickets.