WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11607 closed defect (bug) (fixed)

Slash Missing in get_index_rel_link()

Reported by: miqrogroove Owned by:
Milestone: 3.0 Priority: normal
Severity: minor Version: 2.8
Component: Template Keywords: has-patch tested
Focuses: Cc:

Description

... in link-template.php it looks like get_bloginfo('siteurl') should be user_trailingslashit(get_bloginfo('siteurl')) because my trailing slash is always missing grrrr.

Attachments (1)

11607.diff (607 bytes) - added by nacin 4 years ago.
Also hardens things a bit with esc_url.

Download all attachments as: .zip

Change History (9)

comment:1 miqrogroove4 years ago

  • Keywords needs-patch added

p.s. Filter is missing to. The full call should be user_trailingslashit(get_bloginfo('siteurl', 'display')) so that the link can get filtered.

comment:2 nacin4 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from 2.9.1 to 3.0

get_bloginfo('siteurl') is actually deprecated -- this is its only use in core, apparently -- and user_trailingslashit conditionally slashes a URL depending on the permalink settings, so you're looking for trailingslashit.

I'm finding some other instances like this of 'display' not being triggered in core. Let's do another ticket for that.

nacin4 years ago

Also hardens things a bit with esc_url.

comment:3 miqrogroove4 years ago

  • Keywords tested added

comment:4 westi4 years ago

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

(In [12588]) Don't pass deprecated argument to get_bloginfo() in get_index_rel_link() also observer user trailing slash preferences. Fixes #11607 props nacin and miqrogroove.

comment:5 follow-up: miqrogroove4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I confirmed what nacin said earlier, user_trailingslashit was not the correct wrapper for bloginfo('url'). trailingslashit seems to be the norm.

comment:6 in reply to: ↑ 5 westi4 years ago

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

Replying to miqrogroove:

I confirmed what nacin said earlier, user_trailingslashit was not the correct wrapper for bloginfo('url'). trailingslashit seems to be the norm.

I went with user_trailingslashit as I believe this fits with the intention of that function.

The other rel links that end up in the head also use it.

We could probably review all calls to trailingslashit and think about whether or not user_trailingslashit should be used but that is the subject of another ticket and is probably a rabbit hole we should not venture down.

comment:7 miqrogroove4 years ago

In particular, the /?p= links are using trailingslashit. I suspect the original intention was to do that only for root paths, but that isn't how it worked out.

comment:8 nacin4 years ago

The point of user_trailingslashit, as I understand it, is to distinguish between the option of www.example.com/2009/03/24/hello-world and www.example.com/2009/03/24/hello-world/.

I suppose that could also be translated to www.example.com and www.example.com/subdirectory/blog versus www.example.com/ and www.example.com/subdirectory/blog/.

Note: See TracTickets for help on using tickets.