File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,18 @@ trait SizeTrait
1515 */
1616 protected function getValueSize ($ value )
1717 {
18- if (is_int ($ value ) || is_numeric ($ value )) {
18+ if ( $ this ->getAttribute () && ( $ this ->getAttribute ()->hasRule ( 'numeric ' ) || $ this ->getAttribute ()->hasRule ( 'integer ' ) ) && is_numeric ( $ value ) ) {
19+ $ value = (float ) $ value ;
20+ }
21+
22+ if ( is_int ( $ value ) || is_float ( $ value ) ) {
1923 return (float ) $ value ;
20- } elseif (is_string ($ value) ) {
21- return (float ) mb_strlen ($ value , 'UTF-8 ' );
22- } elseif ($ this ->isUploadedFileValue ($ value) ) {
24+ } elseif ( is_string ( $ value ) ) {
25+ return (float ) mb_strlen ( $ value , 'UTF-8 ' );
26+ } elseif ( $ this ->isUploadedFileValue ( $ value ) ) {
2327 return (float ) $ value ['size ' ];
24- } elseif (is_array ($ value) ) {
25- return (float ) count ($ value );
28+ } elseif ( is_array ( $ value ) ) {
29+ return (float ) count ( $ value );
2630 } else {
2731 return false ;
2832 }
You can’t perform that action at this time.
0 commit comments