#139 Improved string size verification, the rule is guaranteed by the core

SVN:trunk[721]
This commit is contained in:
Romain Quetiez
2010-08-30 16:11:46 +00:00
parent 0d499ef03a
commit 8a788acb9a
2 changed files with 40 additions and 1 deletions

View File

@@ -636,7 +636,15 @@ abstract class DBObject
return "Value not allowed [$toCheck]";
}
}
elseif (!$oAtt->CheckFormat($toCheck))
if (!is_null($iMaxSize = $oAtt->GetMaxSize()))
{
$iLen = strlen($toCheck);
if ($iLen > $iMaxSize)
{
return "String too long (found $iLen, limited to $iMaxSize)";
}
}
if (!$oAtt->CheckFormat($toCheck))
{
return "Wrong format [$toCheck]";
}