| @@ -1,16 +1,16 @@ | ||
| 1 | -<?php | |
| 2 | -class Validation_RegExp extends Validation { | |
| 3 | - protected $message = "Error: %element% contains invalid characters."; | |
| 4 | - protected $pattern; | |
| 5 | - | |
| 6 | - public function __construct($pattern, $message = "") { | |
| 7 | - $this->pattern = $pattern; | |
| 8 | - parent::__construct($message); | |
| 9 | - } | |
| 10 | - | |
| 11 | - public function isValid($value) { | |
| 12 | - if($this->isNotApplicable($value) || preg_match($this->pattern, $value)) | |
| 13 | - return true; | |
| 14 | - return false; | |
| 15 | - } | |
| 16 | -} | |
| 1 | +<?php | |
| 2 | +class Validation_RegExp extends Validation { | |
| 3 | + protected $message = "Error: %element% contains invalid characters."; | |
| 4 | + protected $pattern; | |
| 5 | + | |
| 6 | + public function __construct($pattern, $message = "") { | |
| 7 | + $this->pattern = $pattern; | |
| 8 | + parent::__construct($message); | |
| 9 | + } | |
| 10 | + | |
| 11 | + public function isValid($value) { | |
| 12 | + if($this->isNotApplicable($value) || preg_match($this->pattern, $value)) | |
| 13 | + return true; | |
| 14 | + return false; | |
| 15 | + } | |
| 16 | +} | |