]> jfr.im git - irc/freenode/gms.git/commitdiff
Allow requesting multiple channel namespaces at group registration.
authormniip <redacted>
Sat, 27 Feb 2016 18:56:45 +0000 (18:56 +0000)
committermniip <redacted>
Sat, 27 Feb 2016 18:56:45 +0000 (18:56 +0000)
lib/GMS/Web/Controller/Group.pm
root/src/group/new.tt

index 3bbfcfee41578d9e9001e22fd524e24ecb069184..8b54ffc21c26f9e0ee38eca3fa48fd1fabdd6463 100644 (file)
@@ -1271,7 +1271,8 @@ sub do_new :Chained('base') :PathPart('new/submit') :Args(0) {
         
     }
 
-    my @channels = split /, */, $p->{channel_namespace};
+    my $namespaces = $p->{channel_namespace};
+    my @channels = grep {$_ ne ""} (split /\s*,\s*/, $namespaces);
 
     foreach my $channel_ns ( @channels ) {
         $channel_ns =~ s/^\#//;
index 51383d317419b2de630ac59c212db9a100cf3955..7229b43cd1906ca1233f5ca916265b355c3b1286 100644 (file)
@@ -45,7 +45,7 @@ to help us verify your registration.</p>
     <div class="form-group">
         <label for="group_cns" class="col-sm-3 control-label">* Channel Namespace</label>
         <div class="input-group col-sm-9">
-            <input type="text" required pattern="#?[A-Za-z0-9_\.]*(-\*)?$" maxlength="50" title="Channel namespaces must contain only alphanumeric characters, underscores, and dots" id="group_cns" name="channel_namespace" class="form-control" value="[% channel_namespace | html %]" />
+            <input type="text" required pattern="\s*(#?[A-Za-z0-9_\.]*(-\*)?(,\s*)?)*\s*$" maxlength="50" title="Channel namespaces must contain only alphanumeric characters, underscores, and dots" id="group_cns" name="channel_namespace" class="form-control" value="[% channel_namespace | html %]" />
             <span class="input-group-addon" onmouseover="tooltip(this, 4)" onmouseout="untooltip()"><i class="glyphicon glyphicon-question-sign"></i></span>
         </div>
     </div>