Add MAX_SUBJ_LENGTH to container
This commit is contained in:
parent
2a014a7f91
commit
769a9a69d7
4 changed files with 21 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue