Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#60286 closed defect (bug) (invalid)

Unencrypted links get their "http://" stripped from href attribute

Reported by: vicobot's profile vicobot Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description (last modified by sabernhardt)

When you enter a link that starts with http://, WordPress will strip that, leaving you with an URL like in the href attribute. Links that start with https:// do not show this behaviour.

To reproduce:

  • Take a fresh WordPress install with the latest version (I downgraded one of my sites back to 6.0, and it still had the same problem; I did not test with a classic theme).
  • Create a post with a couple of internal and external links, some starting with http, some starting with https.
  • Publish and view the post.
  • Hover the mouse over the links and observe the links shown at the bottom of the browser window: https-links will look ok, links that you entered with http:// will have lost the scheme and the slashes, so that they start with the servername.

Expected output: Both http and https URLs in href attributes should be left intact and keep the specified scheme and the slashes.

Change History (5)

#1 @vicobot
3 months ago

Forgot to mention that this only affects the rendered post. Inside the post editor / the database, the links are as you entered them, with http:// at the start.

Last edited 3 months ago by sabernhardt (previous) (diff)

#2 @sabernhardt
3 months ago

  • Component changed from General to Editor
  • Description modified (diff)

#3 @TobiasBg
3 months ago

  • Keywords reporter-feedback added
  • Version 6.4.2 deleted

@vicobot: Can you please check what the HTML output for these links looks like (via right-click and "View Source")?

The URL that is shown in that browser status bar is often shown in modified for, and I believe to have read that the browser won't show the http:// there (but only https://). In the HTML source code, and when clicking that link, the http:// is respected, however.

#4 @vicobot
3 months ago

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

Hi @TobiasBg, I did check the source code, and you are right: in there, both kinds of links look like they should. It's just the browser messing with me.

Sorry for the ruckus, my bad. I have set the Action of this ticket to "resolve as invalid", I hope that is the right one.


#5 @TobiasBg
3 months ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted

@vicobot: No problem at all! :-) Good to hear that this could be resolved so quickly!

And yes, invalid is the proper choice here (sorry that it sounds so unfriendly -- it's a technical term).

Note: See TracTickets for help on using tickets.