Changeset 1482

Show
Ignore:
Timestamp:
03/06/08 01:50:44 (2 years ago)
Author:
fumiakiy
Message:

Return error insted of making the value valid.

Files:
1 modified

Legend:

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

    r1481 r1482  
    196196    $app->{search_string} = $search_string; 
    197197    my $offset = $q->param('startIndex') || $q->param('offset') || 0; 
    198     $offset =~ s/\D//g; 
     198    return $app->errtrans('Invalid value: [_1]', encode_html($offset)) 
     199        if $offset && $offset !~ /^\d+$/; 
    199200    my $limit = $q->param('count') || $q->param('limit'); 
    200     $limit =~ s/\D//g if defined $limit; 
     201    return $app->errtrans('Invalid value: [_1]', encode_html($limit)) 
     202        if $limit && $limit !~ /^\d+$/; 
    201203    my $max = $app->{searchparam}{MaxResults}; 
    202204    $max =~ s/\D//g if defined $max;