inline: Handle obfuscated urls, such as the mailto urls generated by markdown when forcing urls absolute.
That took me 5 minutes. If anyone thinks obfuscated email urls stops, or even slows down spammers, think again.master
parent
add72de71a
commit
a18a62aa30
|
@ -564,13 +564,15 @@ sub absolute_urls ($$) {
|
|||
next unless $v_offset; # 0 v_offset means no value
|
||||
my $v = substr($text, $v_offset, $v_len);
|
||||
$v =~ s/^([\'\"])(.*)\1$/$2/;
|
||||
if ($v=~/^#/) {
|
||||
eval q{use HTML::Entities};
|
||||
my $dv = decode_entities($v);
|
||||
if ($dv=~/^#/) {
|
||||
$v=$baseurl.$v; # anchor
|
||||
}
|
||||
elsif ($v=~/^(?!\w+:)[^\/]/) {
|
||||
elsif ($dv=~/^(?!\w+:)[^\/]/) {
|
||||
$v=$url.$v; # relative url
|
||||
}
|
||||
elsif ($v=~/^\//) {
|
||||
elsif ($dv=~/^\//) {
|
||||
if (! defined $urltop) {
|
||||
# what is the non path part of the url?
|
||||
my $top_uri = URI->new($url);
|
||||
|
|
|
@ -27,6 +27,8 @@ ikiwiki (3.20110609) UNRELEASED; urgency=low
|
|||
fixes sorting comments by date. (smcv)
|
||||
* Run scan hooks for internal pages (preprocess hooks already run in scan
|
||||
mode) (smcv)
|
||||
* inline: Handle obfuscated urls, such as the mailto urls generated by
|
||||
markdown when forcing urls absolute.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Thu, 09 Jun 2011 10:06:44 -0400
|
||||
|
||||
|
|
|
@ -17,4 +17,13 @@ for HTML, but
|
|||
|
||||
for Atom and RSS.
|
||||
|
||||
|
||||
> This garbling is provably pointless. Proof: For $1000 I will take off my
|
||||
> white hat, put on my black hat, and implement support for it in any
|
||||
> spammer's email address extraction tool. Money will be donated to a
|
||||
> spam-fighting organisation of my choice.
|
||||
>
|
||||
> So, in leu of money, it seems best to find a way to disable it in
|
||||
> markdown.
|
||||
>
|
||||
> Anyway, I've fixed this, at the expense of additional total worldwide
|
||||
> power usage, etc. --[[Joey]]
|
||||
|
|
Loading…
Reference in New Issue