LP#1400801 - Updated email validation regex for Org Unit admin gui
authorJosh Stompro <stomproj@larl.org>
Thu, 11 Jun 2015 01:12:10 +0000 (20:12 -0500)
committerBen Shum <bshum@biblio.org>
Thu, 5 Nov 2015 18:33:56 +0000 (13:33 -0500)
Grabbed the example of a simplified RFC 5322 email regex from
http://www.regular-expressions.info/email.html and lightly modified it
for case sensitivity and removed the "&" character from the localpart allowed
characters, which causes a 500 server error for some reason.

This matches many more of the valid localpart special characters.

Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/web/conify/global/actor/org_unit.html

index 2c34a67..851a9ec 100644 (file)
                                                        <tr>
                                                                <th>&conify.org_unit.editor_pane.main_email;</th>
                                                                <td>
-                                                                       <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="^\w+(?:\.\w+)*\@\w+(?:\.\w+)+$">
+                                                                       <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="[a-zA-Z0-9!#$%'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?">
                                                                                <script type="dojo/connect" event="onChange">
                                                                                        if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
                                                                                </script>