You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/09/15 11:27:19 UTC

(ofbiz-framework) branch release24.09 updated: Fixed: createEmailAddress and updateEmailAddress accept blank email addresses (OFBIZ-13582)

This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new a2fcc9dee8 Fixed: createEmailAddress and updateEmailAddress accept blank email addresses (OFBIZ-13582)
a2fcc9dee8 is described below

commit a2fcc9dee87f1a736ee065c2daa71fdf0fee8198
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Tue Sep 15 15:49:25 2026 +0530

    Fixed: createEmailAddress and updateEmailAddress accept blank email addresses (OFBIZ-13582)
    
    Both methods gated only on UtilValidate.isEmail(parameters.emailAddress), which returns true for a null or blank string by design. Combined with the servicedef declaring emailAddress required but with no type-validate rule, and the service engine's required-parameter check only rejecting null rather than blank, a caller passing an empty string sailed through and created or updated a real ContactMech with a blank infoString. The original minilang had two explicit checks, not-empty then [...]
---
 .../org/apache/ofbiz/party/contact/ContactMechServicesScript.groovy | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/contact/ContactMechServicesScript.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/contact/ContactMechServicesScript.groovy
index 4126f25546..c815df2e34 100644
--- a/applications/party/src/main/groovy/org/apache/ofbiz/party/contact/ContactMechServicesScript.groovy
+++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/contact/ContactMechServicesScript.groovy
@@ -189,6 +189,9 @@ Map updateTelecomNumber() {
  * Create an email address contact mechanism
  */
 Map createEmailAddress() {
+    if (!parameters.emailAddress) {
+        return error(UtilProperties.getMessage('PartyUiLabels', 'PartyEmailAddressMissing', locale))
+    }
     if (UtilValidate.isEmail(parameters.emailAddress)) {
         Map createContactMechMap = [contactMechTypeId: 'EMAIL_ADDRESS',
                                     contactMechId: parameters.contactMechId,
@@ -206,6 +209,9 @@ Map createEmailAddress() {
  * Update an email address contact mechanism
  */
 Map updateEmailAddress() {
+    if (!parameters.emailAddress) {
+        return error(UtilProperties.getMessage('PartyUiLabels', 'PartyEmailAddressMissing', locale))
+    }
     if (UtilValidate.isEmail(parameters.emailAddress)) {
         Map updateContactMechMap = [contactMechTypeId: 'EMAIL_ADDRESS',
                                     contactMechId: parameters.contactMechId,