Changeset 2739

Show
Ignore:
Timestamp:
07/09/08 04:10:57 (19 months ago)
Author:
fumiakiy
Message:

Applied the fix to the latest release to the legacy code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/App/Search/Legacy.pm

    r1823 r2739  
    292292    ## blog from the database. 
    293293    my($blog); 
    294     my $include = $app->param('IncludeBlogs'); 
     294    my $include = $app->param('IncludeBlogs') || '';   
     295    $include =~ s/[^\d,]//g;   
    295296    if ($include) { 
    296297        my @blog_ids = split ',', $include; 
     
    303304            $blog = MT::Blog->load($app->param('blog_id')); 
    304305        } 
    305         $include = $blog->id if $blog; 
    306     } 
     306        $include = $blog->id if $blog;   
     307    }   
     308    return $app->error($app->translate('Invalid request.'))   
     309        unless $blog;   
    307310 
    308311    ## Initialize and set up the context object. 
     
    317320    } 
    318321    $ctx->stash('template_id', $app->{searchparam}{Template}); 
    319     $ctx->stash('maxresults', $app->{searchparam}{MaxResults}); 
     322    my $maxresults = $app->{searchparam}{MaxResults} || '';   
     323    $maxresults =~ s/\D//g;   
     324    $app->{searchparam}{MaxResults} = $maxresults;   
     325    $ctx->stash('maxresults', $maxresults);   
    320326    $ctx->var( 'page_layout', $blog->page_layout ) 
    321327        if $blog && $blog->page_layout;