"Applied fix from plugins for revision: 1862466 "

------------------------------------------------------------------------
r1862466 | jleroux | 2019-07-03 15:30:28 +0200 (mer. 03 juil. 2019) | 20 lignes

Fixed: Error message is displayed when user having space in username logs 
in at ecommerce
(OFBIZ-10671)

Steps to regenerate:
 # Open URL: [https://demo-trunk.ofbiz.apache.org/ecommerce/control/main]
 # Click on register in header section
 # Provide all the mandatory information but provide a user name such that is 
    contains a space (like: Walter White or Jesse Pinkman)
 # Click on save button

Actual: When user clicks on save button then he is redirected to main page of 
ecommerce and an error message is displayed. 
Similarly when user with space in username tries to login, error message is 
displayed. 

Praven: Added standard regex for username allowed alphabets, numbers, and _-
jleroux: actually "-" was  missing in the regepx definition.

Thanks: Arpit Mor for report and Praveen Sharma for the fix
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/branches/release17.12@1862473 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-07-03 13:33:19 +00:00
parent 77c20ee229
commit 9fa8357112
@@ -168,6 +168,20 @@ under the License.
</if-compare>
</else>
</if-compare>
<if-compare operator="not-equals" field="parameters.UNUSEEMAIL" value="on">
<if>
<condition>
<not>
<if-regexp field="parameters.USERNAME" expr="^[a-zA-Z0-9_-]+$"></if-regexp>
</not>
</condition>
<then>
<add-error>
<fail-property resource="PartyUiLabels" property="NotValidUserName"/>
</add-error>
</then>
</if>
</if-compare>
<!-- Create the Home Phone -->
<if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">