Bug fix for Argument class - added global $lang in validation methods.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8725 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-08-04 18:05:54 +00:00
parent f64e950463
commit da8302fa4a
2 changed files with 67 additions and 31 deletions

View file

@ -97,6 +97,7 @@
function checkFilter($filter_type){
if(isset($this->value) && $this->value != ''){
global $lang;
$val = $this->value;
$key = $this->name;
switch($filter_type) {
@ -146,25 +147,28 @@
function checkMaxLength($length){
if($this->value && (strlen($this->value) > $length)){
global $lang;
$this->isValid = false;
$key = $this->name;
$this->errorMessage = new Object(-1, $lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key);
$this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key));
}
}
function checkMinLength($length){
if($this->value && (strlen($this->value) > $length)){
if($this->value && (strlen($this->value) < $length)){
global $lang;
$this->isValid = false;
$key = $this->name;
$this->errorMessage = new Object(-1, $lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key);
$this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key));
}
}
function checkNotNull(){
if(!isset($this->value)){
global $lang;
$this->isValid = false;
$key = $this->name;
$this->errorMessage = new Object(-1, $lang->filter->isnull, $lang->{$key} ? $lang->{$key} : $key);
$this->errorMessage = new Object(-1, sprintf($lang->filter->isnull, $lang->{$key} ? $lang->{$key} : $key));
}
}
}