]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
fix decimal validator
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 6 Aug 2013 23:21:09 +0000 (02:21 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 6 Aug 2013 23:21:09 +0000 (02:21 +0300)
ipf/orm/validator.php

index 526471e354d41cdab4c2629d7ead67facd94e757..104d089bb2d41737ac0b015141078d02cd15048c 100644 (file)
@@ -82,9 +82,14 @@ class IPF_ORM_Validator
             return true;
         } else if ($type == 'array' || $type == 'object') {
             $length = strlen(serialize($value));
+        } else if ($type == 'decimal') {
+            if (!$maximumLength)
+                $maximumLength = 18;
+            $length = strlen($value);
         } else {
             $length = strlen($value);
         }
+
         if ($length > $maximumLength) {
             return false;
         }