From d3fba4c1e6662777906051c8345174f8325db4ed Mon Sep 17 00:00:00 2001 From: Manager Bot Date: Thu, 3 Nov 2022 05:17:35 +0000 Subject: [PATCH] Fix amarith bug. --- Web/lib/MJB/Web/Controller/Blog.pm | 6 ++++++ 1 file changed, 6 insertions(+) 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};