Moved max post source length to config
This commit is contained in:
parent
440f7140ff
commit
1600589793
2 changed files with 4 additions and 1 deletions
|
@ -39,6 +39,9 @@ showDislikedPostsDefault=1
|
||||||
maxSearchTokens=4
|
maxSearchTokens=4
|
||||||
maxRelatedPosts=50
|
maxRelatedPosts=50
|
||||||
|
|
||||||
|
[posts]
|
||||||
|
maxSourceLength = 200
|
||||||
|
|
||||||
[comments]
|
[comments]
|
||||||
minLength = 5
|
minLength = 5
|
||||||
maxLength = 2000
|
maxLength = 2000
|
||||||
|
|
|
@ -284,7 +284,7 @@ class PostModel extends AbstractCrudModel
|
||||||
{
|
{
|
||||||
$source = trim($source);
|
$source = trim($source);
|
||||||
|
|
||||||
$maxLength = 200;
|
$maxLength = getConfig()->posts->maxSourceLength;
|
||||||
if (strlen($source) > $maxLength)
|
if (strlen($source) > $maxLength)
|
||||||
throw new SimpleException('Source must have at most %d characters', $maxLength);
|
throw new SimpleException('Source must have at most %d characters', $maxLength);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue