1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 07:54:24 +03:00

fix текстовых валидаторов

This commit is contained in:
Mzhelskiy Maxim 2012-04-07 08:59:25 +04:00
parent 5e9223997b
commit 1cb7e7dea8
8 changed files with 24 additions and 5 deletions

View file

@ -37,7 +37,9 @@ class ModuleValidate_EntityValidatorCaptcha extends ModuleValidate_EntityValidat
* @return bool|string
*/
public function validate($sValue) {
$sValue=(string)$sValue;
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_captcha_not_valid',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -49,7 +49,9 @@ class ModuleValidate_EntityValidatorDate extends ModuleValidate_EntityValidator
* @return bool|string
*/
public function validate($sValue) {
$sValue=(string)$sValue;
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_date_format_invalid',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -77,6 +77,9 @@ class ModuleValidate_EntityValidatorEmail extends ModuleValidate_EntityValidator
* @return bool|string
*/
public function validate($sValue) {
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_email_not_valid',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -86,6 +86,9 @@ class ModuleValidate_EntityValidatorNumber extends ModuleValidate_EntityValidato
* @return bool|string
*/
public function validate($sValue) {
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_number_must_number',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -57,7 +57,9 @@ class ModuleValidate_EntityValidatorRegexp extends ModuleValidate_EntityValidato
* @return bool|string
*/
public function validate($sValue) {
$sValue=(string)$sValue;
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_regexp_invalid_pattern',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -75,7 +75,9 @@ class ModuleValidate_EntityValidatorString extends ModuleValidate_EntityValidato
* @return bool|string
*/
public function validate($sValue) {
$sValue=(string)$sValue;
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_string_too_short',null,false),'msgTooShort',array('min'=>$this->min));
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -61,7 +61,9 @@ class ModuleValidate_EntityValidatorTags extends ModuleValidate_EntityValidator
* @return bool|string
*/
public function validate($sValue) {
$sValue=(string)$sValue;
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_tags_empty',null,false),'msg',array('min'=>$this->min,'max'=>$this->max));
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}

View file

@ -62,6 +62,9 @@ class ModuleValidate_EntityValidatorUrl extends ModuleValidate_EntityValidator {
* @return bool|string
*/
public function validate($sValue) {
if (is_array($sValue)) {
return $this->getMessage($this->Lang_Get('validate_url_not_valid',null,false),'msg');
}
if($this->allowEmpty && $this->isEmpty($sValue)) {
return true;
}