File tree 2 files changed +7
-3
lines changed
src/Symfony/Component/Validator
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,10 @@ private function normalizeBinaryFormat($maxSize)
102
102
$ factors = [
103
103
'k ' => 1000 ,
104
104
'ki ' => 1 << 10 ,
105
- 'm ' => 1000000 ,
105
+ 'm ' => 1000 * 1000 ,
106
106
'mi ' => 1 << 20 ,
107
+ 'g ' => 1000 * 1000 * 1000 ,
108
+ 'gi ' => 1 << 30 ,
107
109
];
108
110
if (ctype_digit ((string ) $ maxSize )) {
109
111
$ this ->maxSize = (int ) $ maxSize ;
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ public function provideValidSizes()
97
97
['1MI ' , 1048576 , true ],
98
98
['3m ' , 3000000 , false ],
99
99
['3M ' , 3000000 , false ],
100
+ ['1gi ' , 1073741824 , true ],
101
+ ['1GI ' , 1073741824 , true ],
102
+ ['4g ' , 4000000000 , false ],
103
+ ['4G ' , 4000000000 , false ],
100
104
];
101
105
}
102
106
@@ -107,8 +111,6 @@ public function provideInvalidSizes()
107
111
['foo ' ],
108
112
['1Ko ' ],
109
113
['1kio ' ],
110
- ['1G ' ],
111
- ['1Gi ' ],
112
114
];
113
115
}
114
116
You can’t perform that action at this time.
0 commit comments