Add MAX_SUBJ_LENGTH to container

This commit is contained in:
Visman 2023-07-30 21:24:18 +07:00
parent 2a014a7f91
commit 769a9a69d7
4 changed files with 21 additions and 2 deletions

View file

@ -813,4 +813,22 @@ class Update extends Admin
return null;
}
/**
* rev.64 to rev.65
*/
protected function stageNumber64(array $args): ?int
{
$coreConfig = new CoreConfig($this->configFile);
$coreConfig->add(
'MAX_SUBJ_LENGTH',
'70',
'MAX_POST_SIZE'
);
$coreConfig->save();
return null;
}
}

View file

@ -76,7 +76,7 @@ trait PostFormTrait
$fieldset['subject'] = [
'class' => ['w0'],
'type' => 'text',
'maxlength' => '70',
'maxlength' => $this->c->MAX_SUBJ_LENGTH,
'caption' => 'Subject',
'required' => true,
'value' => $vars['subject'] ?? null,

View file

@ -163,7 +163,7 @@ trait PostValidatorTrait
}
if ($first) {
$ruleSubject = 'required|string:trim,spaces|min:1|max:70|' . ($executive ? '' : 'noURL|') . 'check_subject';
$ruleSubject = 'required|string:trim,spaces|min:1|max:' . $this->c->MAX_SUBJ_LENGTH . '|' . ($executive ? '' : 'noURL|') . 'check_subject';
} else {
$ruleSubject = 'absent';
}

View file

@ -43,6 +43,7 @@ return [
'smTplBl' => ['url'],
],
'MAX_POST_SIZE' => 65536,
'MAX_SUBJ_LENGTH' => 70, // max 255
'MAX_IMG_SIZE' => '2M',
'MAX_FILE_SIZE' => '2M',
'MAX_EMAIL_LENGTH' => 80,