Fixed quota regex
This commit is contained in:
parent
06fcef7433
commit
ce497f9728
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ class UserController extends Controller
|
|||
$validator = $this->getUserCreateValidator($request)
|
||||
->callIf($this->getSetting('quota_enabled') === 'on', function ($session) use (&$maxUserQuota, &$request) {
|
||||
$maxUserQuota = param($request, 'max_user_quota', humanFileSize($this->getSetting('default_user_quota'), 0, true));
|
||||
if (!preg_match('/([0-9]+[K|M|G|T])|(\-1)/i', $maxUserQuota)) {
|
||||
if (!preg_match('/(^[0-9]+[B|K|M|G|T]$)|(^\-1$)/i', $maxUserQuota)) {
|
||||
$session->alert(lang('invalid_quota', 'danger'));
|
||||
return false;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ class UserController extends Controller
|
|||
->alertIf($user->id === $this->session->get('user_id') && param($request, 'is_admin') === null, 'cannot_demote')
|
||||
->callIf($this->getSetting('quota_enabled') === 'on', function ($session) use (&$user, &$request) {
|
||||
$maxUserQuota = param($request, 'max_user_quota', humanFileSize($this->getSetting('default_user_quota'), 0, true));
|
||||
if (!preg_match('/([0-9]+[K|M|G|T])|(\-1)/i', $maxUserQuota)) {
|
||||
if (!preg_match('/(^[0-9]+[B|K|M|G|T]$)|(^\-1$)/i', $maxUserQuota)) {
|
||||
$session->alert(lang('invalid_quota', 'danger'));
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue