diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-06-03 17:10:32 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-06-03 17:10:32 +0000 |
commit | d9a3c2bed29f7ff6f7a12d1d421e4c88fa97b264 (patch) | |
tree | 1d39dc20c788d4e901f6a92581f343cc100fb26f | |
parent | aadb21422065dc225cfbf487c56382e2b0ae8bcd (diff) |
* Make the url absolution code for feeds significantly more robust.
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 6 | ||||
-rw-r--r-- | debian/changelog | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index e23f7b903..67aaa817e 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -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; } #}}} diff --git a/debian/changelog b/debian/changelog index dd7f509b3..9c558b33e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 |