19

A small reminder that many short links domains (link shorteners) are impossible to post or edit by choice of the community. This includes goo.gl, bit.ly, tinyurl.com, cl.ly, etc.

Consequently, editing old post (older than this policy) to improve them may require to replace the short links with their destination. But I found a few cases where the short link is part of an error message, and I wonder if editing them out is degrading the searchability of such error message.

For instance, in the following post, there was a broken short link part of an error message: was my edit (revision 5) adequate regarding the replacement of the link destination to a newer version of the docs?
https://stackoverflow.com/posts/4864657/revisions

8
  • Some time between answering this question and now, it dawned on me that one possible reason the asker might have left the link out was because it was a goo.gl link. Except I'll never know because the asker never so much as acknowledged the link's very existence and never responded to anyone's inquiries about it.
    – BoltClock
    Oct 15, 2018 at 14:38
  • @BoltClock I'm a bit confused about your comment, as I can't find any goo.gl link.
    – Cœur
    Oct 15, 2018 at 14:41
  • 4
    Exactly. There was no mention of a link, but I can tell you for a fact that the error message does come with a link. The fact that goo.gl is banned might have been the reason why the asker omitted the link from their question altogether. But until they confirm it, it's only a possibility.
    – BoltClock
    Oct 15, 2018 at 14:42
  • 3
    Hmm. I would put a ‍ in the middle of the URL so it renders as text and not a URL. It shows the message but is not clickable.... Oct 15, 2018 at 16:37
  • 2
    Wait, we banned link shorteners? Goddammit. When will we finally learn that these naive automated filters always break good content? Looks like you've just encountered one of the inevitable failure cases I predicted back when I said, about a suggested link shortener ban, that I would hate for Stack Exchange to create another filter which is right in 99% of cases but cripplingly annoying in the 1% of edge cases.
    – Mark Amery
    Oct 16, 2018 at 10:57
  • 1
    Here is another recent case when I got against this limitation by pasting literal output of a system: askubuntu.com/posts/1083504/revisions
    – Ferrybig
    Oct 16, 2018 at 17:12
  • Does it still block the post if you format the error message as a code block instead of a block quote?
    – jpmc26
    Oct 16, 2018 at 20:01
  • @jpmc26 if I remember correctly, yes it does block code as well, which is problematic when the question is related to redirections usage in programming.
    – Cœur
    Oct 17, 2018 at 2:11

1 Answer 1

16

Work around the filter by entity-encoding a character in the domain name of the link shortener. For example, this markdown...

http://goo.gl/UEhtg

renders like this, and bypasses the filter:

http://goo.gl/UEhtg

It's more awkward if you have to do this inside a code block, since HTML entities in a four-space-indented block in SO-flavoured markdown don't get decoded. That is, something like this...

    print('http://goo.gl/UEhtg')

... will simply render like this, which isn't what you want:

print('http://goo.gl/UEhtg')

Instead, in such a case you'll want to use explicit <pre> and <code> elements to format stuff as code instead of four-space indentation. This markdown...

<pre><code>print('http://&#x67;oo.gl/UEhtg')</code></pre>

... renders like this:

print('http://goo.gl/UEhtg')

I agree that removing these links from error messages will damage searchability, since anyone Googling for the whole phrase in double quotes will fail to find the results. Hacking around the filter in an awkward way is preferable to doing damage to posts just because a dumb machine tells us to.

5
  • 6
    So anyone who wants to post a harmful link can bypass the filter by using this trick? Oct 17, 2018 at 0:12
  • Thank you, done in revision 6.
    – Cœur
    Oct 17, 2018 at 2:09
  • 11
    @m69 Or use a domain they control, or a shortener not on the blacklist, or a redirect vulnerability on some otherwise-innocuous domain, etc etc. The filter is meant as a mechanism to combat link rot, not to combat malicious links. It's not possible for it to ever achieve the latter, and its failure to achieve the impossible probably shouldn't be seen as a strike against it.
    – Mark Amery
    Oct 17, 2018 at 9:55
  • If it's in an error log, then there's no need to have it actually linked. Is the entity-encoding alone sufficient to achieve that?
    – OrangeDog
    Oct 18, 2018 at 10:31
  • @OrangeDog Good question. You just got me to play around some more and update the answer.
    – Mark Amery
    Oct 18, 2018 at 10:38

You must log in to answer this question.

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