Show
Ignore:
Timestamp:
07/03/08 18:02:38 (17 months ago)
Author:
bchoate
Message:

Fixed author/commenter icon urls to produce full URLs when static web path is relative (uses blog domain). Fixes the last two remaining tag suite test failures for perl.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/Template/ContextHandlers.pm

    r2684 r2696  
    65446544    return $ctx->_no_author_error() unless $author; 
    65456545    my $size = $args->{size} || 'logo_small'; 
    6546     return $author->auth_icon_url($size); 
     6546    my $url = $author->auth_icon_url($size); 
     6547    if ($url =~ m!^/!) { 
     6548        # relative path, prepend blog domain 
     6549        my $blog = $ctx->stash('blog'); 
     6550        if ($blog) { 
     6551            my ($blog_domain) = $blog->archive_url =~ m|(.+://[^/]+)|; 
     6552            $url = $blog_domain . $url; 
     6553        } 
     6554    } 
     6555    return $url; 
    65476556} 
    65486557 
     
    1116411173    return q() unless $a; 
    1116511174    my $size = $args->{size} || 'logo_small'; 
    11166     return $a->auth_icon_url($size); 
     11175    my $url = $a->auth_icon_url($size); 
     11176    if ($url =~ m!^/!) { 
     11177        # relative path, prepend blog domain 
     11178        my $blog = $ctx->stash('blog'); 
     11179        if ($blog) { 
     11180            my ($blog_domain) = $blog->archive_url =~ m|(.+://[^/]+)|; 
     11181            $url = $blog_domain . $url; 
     11182        } 
     11183    } 
     11184    return $url; 
    1116711185} 
    1116811186