updated core and modules
This commit is contained in:
+7
-5
@@ -88,20 +88,22 @@ class File extends Constraint
|
||||
|
||||
private function normalizeBinaryFormat($maxSize)
|
||||
{
|
||||
$sizeInt = (int) $maxSize;
|
||||
|
||||
if (ctype_digit((string) $maxSize)) {
|
||||
$this->maxSize = (int) $maxSize;
|
||||
$this->maxSize = $sizeInt;
|
||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||
} elseif (preg_match('/^\d++k$/i', $maxSize)) {
|
||||
$this->maxSize = $maxSize * 1000;
|
||||
$this->maxSize = $sizeInt * 1000;
|
||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||
} elseif (preg_match('/^\d++M$/i', $maxSize)) {
|
||||
$this->maxSize = $maxSize * 1000000;
|
||||
$this->maxSize = $sizeInt * 1000000;
|
||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||
} elseif (preg_match('/^\d++Ki$/i', $maxSize)) {
|
||||
$this->maxSize = $maxSize << 10;
|
||||
$this->maxSize = $sizeInt << 10;
|
||||
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
||||
} elseif (preg_match('/^\d++Mi$/i', $maxSize)) {
|
||||
$this->maxSize = $maxSize << 20;
|
||||
$this->maxSize = $sizeInt << 20;
|
||||
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
||||
} else {
|
||||
throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize));
|
||||
|
||||
Reference in New Issue
Block a user