* Make the url absolution code for feeds significantly more robust.

master
joey 2007-06-03 17:10:32 +00:00
parent aadb214220
commit d9a3c2bed2
2 changed files with 5 additions and 4 deletions

View File

@ -302,9 +302,9 @@ sub absolute_urls ($$) { #{{{
my $url=$baseurl;
$url=~s/[^\/]+$//;
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(#[^"]+)"/$1 href="$baseurl$2"/ig;
$content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?!\w+:\/\/)([^"]+)"/$1 href="$url$2"/ig;
$content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?!\w+:\/\/)([^"]+)"/$1 src="$url$2"/ig;
$content=~s/(<a(?:\s+(?:class|id)\s*="?\w+"?)?)\s+href=\s*"(#[^"]+)"/$1 href="$baseurl$2"/mig;
$content=~s/(<a(?:\s+(?:class|id)\s*="?\w+"?)?)\s+href=\s*"(?!\w+:\/\/)([^"]+)"/$1 href="$url$2"/mig;
$content=~s/(<img(?:\s+(?:class|id|width|height)\s*="?\w+"?)*)\s+src=\s*"(?!\w+:\/\/)([^"]+)"/$1 src="$url$2"/mig;
return $content;
} #}}}

3
debian/changelog vendored
View File

@ -34,8 +34,9 @@ ikiwiki (2.2) UNRELEASED; urgency=low
* Add test suite for preprocessor directive parsing.
* Fix wrapper generator and untaint code's handling of strings contining
newlines.
* Make the url absolution code for feeds significantly more robust.
-- Joey Hess <joeyh@debian.org> Sun, 03 Jun 2007 12:20:26 -0400
-- Joey Hess <joeyh@debian.org> Sun, 03 Jun 2007 13:10:08 -0400
ikiwiki (2.1) unstable; urgency=low