CrashTest.pl
changeset 32 3e776f1b21d4
parent 29 006e82a1bcd0
child 34 e0d6597078a5
equal deleted inserted replaced
31:f77c6719c05c 32:3e776f1b21d4
    76         $short_signature = "$1()$2";
    76         $short_signature = "$1()$2";
    77     }
    77     }
    78     return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
    78     return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
    79 };
    79 };
    80 
    80 
       
    81 helper xml_escape_block => sub {
       
    82     my ($c, $block) = @_;
       
    83     my $result = $block->();
       
    84     $result = xml_escape $result;
       
    85     return Mojo::ByteStream->new($result);
       
    86 };
       
    87 
    81 get '/' => sub {
    88 get '/' => sub {
    82     my $self = shift;
    89     my $self = shift;
    83     my $page = 1;
    90     my $page = 1;
    84     $self->validation->required('page')->like(qr/^[0-9]+$/);
    91     $self->validation->required('page')->like(qr/^[0-9]+$/);
    85     $page = scalar $self->validation->param("page") if $self->validation->is_valid('page');
    92     $page = scalar $self->validation->param("page") if $self->validation->is_valid('page');