[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Savannah-hackers-public] Broken links in Savannah news items
From: |
Karl Berry |
Subject: |
Re: [Savannah-hackers-public] Broken links in Savannah news items |
Date: |
Tue, 5 Jul 2016 22:43:37 GMT |
Hi Ludo,
I see this is being worked out:
https://lists.gnu.org/archive/html/savannah-hackers-public/2016-07/msg00005.html
Yesterday's change was the culprit, yes.
Sorry for the noise
On the contrary, it's good you reported it since it was a bug in the fix :).
apparently ôòühttps://ôòý was automatically prepended ...
<http://savannah.gnu.org/forum/forum.php?forum_id=8605>
Actually, "http://" was being incorrectly prepended to "www.".
The https's are yours :).
Sergey: it seems to me we can only safely prepend "http://" if the "www."
is at ^ or preceded by whitespace. As in:
# Prepare usual links: prefix "www." with "http://"
# if it is preceded by whitespace or at the beginning of line.
# (don't want to prefix in cases like "//www.." or "ngwww...")
$line = preg_replace('/(\s|^)(www\.)/i', '$1http://$2', $line);
(I changed over to that line and now Ludo's forum page looks right.)
It's not clear to me what other case is trying to be handled by the
original alternative of [^/], though surely it was something, and maybe
we'll hear about it shortly ... -k