mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-05 07:54:24 +03:00
fix текстовых валидаторов
This commit is contained in:
parent
5e9223997b
commit
1cb7e7dea8
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue