Changeset 2070

Show
Ignore:
Timestamp:
11/02/06 12:24:41
Author:
miyagawa
Message:

don't allow empty default.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mixxi/trunk/lib/Mixxi/Controller/Root.pm

    r2069 r2070  
    5858    my($self, $c) = @_; 
    5959 
    60     my $alias = $c->req->args->[0]; 
    61     my $rs = $c->model('DBIC::Url')->search(alias => $alias); 
     60    eval { 
     61        my $alias = $c->req->args->[0] or die "No alias"; 
     62        my $rs = $c->model('DBIC::Url')->search(alias => $alias); 
     63        $rs->count or die "No url matched $alias"; 
     64        $c->res->redirect($rs->first->url); 
     65    }; 
    6266 
    63     unless ($rs->count) { 
     67    if ($@) { 
    6468        return $c->res->redirect($c->uri_for('/url')); 
    6569    } 
    66  
    67     $c->res->redirect($rs->first->url); 
    6870} 
    6971 
  • Mixxi/trunk/lib/Mixxi/Controller/URL.pm

    r2067 r2070  
    3434 
    3535    if ($alias && !$self->validate_alias($c, $alias)) { 
    36         $c->stash->{error} = 'alias is taken'; 
     36        $c->stash->{error} = 'alias is taken or invalid'; 
    3737        $c->stash->{template} = 'url/index.tt'; 
    3838        return; 
  • Mixxi/trunk/mixxi.yml

    r2067 r2070  
    11--- 
    22name: Mixxi 
    3 tinyurl_base: http://rock:3000
     3tinyurl_base: http://mixxi.jp
    44default_view: TT 
    55View::TT: