Changeset 2696

Show
Ignore:
Timestamp:
07/03/08 18:02:38 (12 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.

Location:
branches/release-41
Files:
2 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 
  • branches/release-41/t/35-tags.dat

    r2689 r2696  
    346346{ "r" : "1", "t" : "<MTEntries lastn=\"10\"><MTIfNonZero tag=\"MTEntryScoreCount\" namespace=\"unit test\"><MTEntryID> <MTEntryRank namespace=\"unit test\">; </MTIfNonZero></MTEntries>", "e" : "6 6; 5 1; 4 4; "}, #294 
    347347{ "r" : "1", "t" : "<MTEntries lastn=\"10\"><MTIfNonZero tag=\"MTEntryScoreCount\" namespace=\"unit test\"><MTEntryID> <MTEntryRank max=\"10\" namespace=\"unit test\">; </MTIfNonZero></MTEntries>", "e" : "6 10; 5 1; 4 5; "}, #295 
    348 { "r" : "1", "t" : "<MTEntries sort_by=\"score\" namespace=\"unit test\"><MTEntryID>; </MTEntries>", "e" : "5; 4; 6; 8; 1; 7; "}, #296 
     348{ "r" : "1", "t" : "<MTEntries glue=\"; \" sort_by=\"score\" namespace=\"unit test\" min_score=\"1\"><MTEntryID>-<MTEntryScore namespace=\"unit test\"></MTEntries>", "e" : "5-12; 4-5; 6-2"}, #296 
    349349{ "r" : "1", "t" : "<MTAssets lastn=\"10\"><MTIfNonZero tag=\"MTAssetScoreCount\" namespace=\"unit test\"><MTAssetID> <MTAssetScore namespace=\"unit test\">; </MTIfNonZero></MTAssets>", "e" : "1 12; 2 5; "}, #297 
    350350{ "r" : "1", "t" : "<MTAssets lastn=\"10\"><MTIfNonZero tag=\"MTAssetScoreCount\" namespace=\"unit test\"><MTAssetID> <MTAssetScoreHigh namespace=\"unit test\">; </MTIfNonZero></MTAssets>", "e" : "1 5; 2 3; "}, #298