fix for already relative urls

master
joey 2006-03-23 21:21:31 +00:00
parent 801a6d61b9
commit 4155fd3c96
1 changed files with 2 additions and 6 deletions

View File

@ -139,12 +139,8 @@ sub absolute_urls ($$) { #{{{
$url=~s/[^\/]+$//;
$content=~s{<a\s+href="([^"]+)"}{
"<a href=\"$url$1\""
}ieg;
$content=~s{<img\s+src="([^"]+)"}{
"<img src=\"$url$1\""
}ieg;
$content=~s/<a\s+href="(?!http:\/\/)([^"]+)"/<a href="$url$1"/ig;
$content=~s/<img\s+src="(?!http:\/\/)([^"]+)"/<img src="$url$1"/ig;
return $content;
} #}}}