diff --git a/Web/lib/MJB/Web/Controller/Blog.pm b/Web/lib/MJB/Web/Controller/Blog.pm index 3abdbe5..ce8f259 100644 --- a/Web/lib/MJB/Web/Controller/Blog.pm +++ b/Web/lib/MJB/Web/Controller/Blog.pm @@ -21,11 +21,17 @@ sub do_create ($c) { push @{$c->stash->{errors}}, "You must enter a subdomain." unless $subdomain; + $subdomain = lc($subdomain); + + push @{$c->stash->{errors}}, "Your subdomain may only contain letters, numbers and hypens." + unless $subdomain =~ /^[a-z0-9-]+$/; + } elsif ( $domain_type eq 'owned' ) { push @{$c->stash->{errors}}, "You must enter a domain." unless $domain; } + return if $c->stash->{errors}; $domain = $domain ? $domain : $subdomain . '.' . $c->config->{customer_domain};