18

See the revision history here on a post from 2016. There is this edit by our resident hero Glorfindel:

Described below

The edit fixed this link, made up of a URL but with two schemes and %20 between them (a URL encoding of a space):

http://%20https://www.playstation.com/en-gb/get-help/help-library/my-account/device-activation-deactivation/about-device-activation/

replacing it with

https://www.playstation.com/en-gb/get-help/help-library/my-account/device-activation-deactivation/about-device-activation/

What caused all of these broken links to be put in posts? Can some automated process fix the remaining ones? There are a lot of them around the sites.

31

humbly accepts compliment

I suspect it's caused by users who copy/paste a link from elsewhere, but accidentally select too much text, more specifically an extra space in front of the link. Like this:

enter image description here

Do you see the difference? I don't, and that's exactly why these broken links happen. The insert dialog above produces the following link:

enter link description here

(clicking it won't work, since it's broken; you can check the source code of this post and it'll show you that it's http://%20https://meta.stackexchange.com)


Can some automated process fix the remaining ones?

I've been toying with this for a while. It's possible to search for url:%20http to find (most of) these posts; that's how I found the example you mentioned. I've written a userscript (maybe I'll publish it someday, right now it's a bit of a mess) which checks posts I'm editing for broken links of this type and tries to fix them. Also, a variation of the Broken Image Repairer is running on the non-English Stack Overflow sites, fixing those links (here are some examples).

The main problem with automated processes is that sometimes the links are broken anyway, even if they had been inserted correctly, and I try to improve other things (grammar/spelling, converting HTTP links to HTTPS) while I'm bumping the post.


Oh, while we're in compliment mode: the user who (probably unknowingly) inspired my crusade against broken links is @Pang, after I saw a couple of their edits across the network.

|improve this answer|||||
  • 2
    Another compliment: great find, Sherlock! – Arjan Nov 2 '19 at 15:33
  • 7
    You have earned the Resident Hero badge for What causes “http://%20https://” links to be made? See your profile. – Frédéric Hamidi Nov 2 '19 at 15:35
  • Gives me a place to thank you for fixing a number of those in my answers on Mi Yodeya. I did wonder how the errors got in there as I typically copy these links with a Cmd-L Cmd-C, and since many of the links you fixed were amazon references, I wonder if this is not the automated SE script that changed those links – mbloch Nov 2 '19 at 16:46
  • 4
    What if the system trimmed the spaces before you submitted the URL? 🤨 – Laurel Nov 2 '19 at 17:21
  • 1
    @Laurel sounds like a good feature-request! – Glorfindel Nov 2 '19 at 18:00
  • 3
    @Glorfindel it’s already been suggested apparently. Upvotes anyone? – Laurel Nov 2 '19 at 18:42
  • Heh ... you would think I should remember that post, given I edited it recently, but that was part of a serial rollback. – Glorfindel Nov 2 '19 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .