mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix: unlimited deployment size
This commit is contained in:
@@ -182,7 +182,7 @@ class Create extends Action
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
|
||||
if (!$fileSizeValidator->isValid($fileSize) && $functionSizeLimit !== 0) { // Check if file size is exceeding allowed limit
|
||||
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ class Builds extends Action
|
||||
$sizeLimit = (int) $plan['deploymentSize'] * 1000 * 1000;
|
||||
}
|
||||
|
||||
if ($directorySize > $sizeLimit) {
|
||||
if ($directorySize > $sizeLimit && $sizeLimit !== 0) {
|
||||
throw new \Exception('Repository directory size should be less than ' . number_format($sizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
}
|
||||
|
||||
@@ -816,7 +816,7 @@ class Builds extends Action
|
||||
if (isset($plan['buildSize'])) {
|
||||
$buildSizeLimit = $plan['buildSize'] * 1000 * 1000;
|
||||
}
|
||||
if ($response['size'] > $buildSizeLimit) {
|
||||
if ($response['size'] > $buildSizeLimit && $buildSizeLimit !== 0) {
|
||||
throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class Create extends Action
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
|
||||
if (!$fileSizeValidator->isValid($fileSize) && $siteSizeLimit !== 0) { // Check if file size is exceeding allowed limit
|
||||
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user