Changeset 22811 for lang/perl/Moxy
- Timestamp:
- 11/06/08 16:13:44 (2 months ago)
- Files:
-
- 1 modified
-
lang/perl/Moxy/trunk/lib/Moxy.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Moxy/trunk/lib/Moxy.pm
r22808 r22811 93 93 } 94 94 95 sub rewrite { 95 sub rewrite_css { 96 my ($base, $css, $url) = @_; 97 my $base_url = URI->new($url); 98 99 $css =~ s{url\(([^\)]+)\)}{ 100 sprintf "url(%s%s%s)", 101 $base, 102 ($base =~ m{/$} ? '' : '/'), 103 uri_escape( URI->new($1)->abs($base_url) ) 104 }ge; 105 106 $css; 107 } 108 109 sub rewrite_html { 96 110 my ($base, $html, $url) = @_; 97 111 … … 231 245 $self->log(debug => "Content-Type: $content_type"); 232 246 if ($content_type =~ /html/i) { 233 $res->content( encode($res->charset, rewrite($base, decode($res->charset, $res->content), $url), Encode::FB_HTMLCREF) ); 247 $res->content( encode($res->charset, rewrite_html($base, decode($res->charset, $res->content), $url), Encode::FB_HTMLCREF) ); 248 } elsif ($content_type =~ m{text/css}) { 249 $res->content( encode($res->charset, rewrite_css($base, decode($res->charset, $res->content), $url), Encode::FB_HTMLCREF) ); 234 250 } 235 251
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)