Changeset 569 for branches/1.1dev/lib


Ignore:
Timestamp:
Oct 29, 2016 2:56:51 AM (8 years ago)
Author:
anonymous
Message:

Fixed email and form validation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/lib/FormValidator.inc.php

    r568 r569  
    414414                // Check domain exists: It's a domain if ip2long fails; checkdnsrr ensures a MX record exists; gethostbyname() ensures the domain exists.
    415415                $this->addError($form_name, sprintf(_("The email address <em>%s</em> does not have a valid domain name."), oTxt(getFormData($form_name))), MSG_ERR, __FILE__, __LINE__);
    416                 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)));
     416                logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)));
    417417                return false;
    418418            }
     
    435435        $phone = getFormData($form_name);
    436436
    437         $this->checkRegex($form_name, '/^[0-9 +().-]*$/', true, sprintf(_("The phone number <strong>%s</strong> is not valid."), $phone));
    438         $this->stringLength($form_name, 0, 25, sprintf(_("The phone number <strong>%s</strong> is too long"), $phone));
     437        if ($this->checkRegex($form_name, '/^[0-9 +().-]*$/', true, sprintf(_("The phone number <strong>%s</strong> is not valid."), $phone))
     438        && $this->stringLength($form_name, 0, 25, sprintf(_("The phone number <strong>%s</strong> is too long"), $phone))) {
     439            return true;
     440        }
     441        return false;
    439442    }
    440443
Note: See TracChangeset for help on using the changeset viewer.