Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Code formatting in EmailField

  • Loading branch information...
commit 8369cded32f0af05fbd8b4414300195942f183a3 1 parent 1e61b76
@halkyon halkyon authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 forms/EmailField.php
View
9 forms/EmailField.php
@@ -19,18 +19,17 @@ function Type() {
* @param Validator $validator
* @return String
*/
- function validate($validator){
+ function validate($validator) {
$this->value = trim($this->value);
-
- $pcrePattern = '^[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$';
+ $pcrePattern = '^[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$';
// PHP uses forward slash (/) to delimit start/end of pattern, so it must be escaped
$pregSafePattern = str_replace('/', '\\/', $pcrePattern);
if($this->value && !preg_match('/' . $pregSafePattern . '/i', $this->value)){
- $validator->validationError(
- $this->name,
+ $validator->validationError(
+ $this->name,
_t('EmailField.VALIDATION', "Please enter an email address."),
"validation"
);
Please sign in to comment.
Something went wrong with that request. Please try again.