Moved max post source length to config

This commit is contained in:
Marcin Kurczewski 2014-05-06 11:28:24 +02:00
parent 440f7140ff
commit 1600589793
2 changed files with 4 additions and 1 deletions

View file

@ -39,6 +39,9 @@ showDislikedPostsDefault=1
maxSearchTokens=4
maxRelatedPosts=50
[posts]
maxSourceLength = 200
[comments]
minLength = 5
maxLength = 2000

View file

@ -284,7 +284,7 @@ class PostModel extends AbstractCrudModel
{
$source = trim($source);
$maxLength = 200;
$maxLength = getConfig()->posts->maxSourceLength;
if (strlen($source) > $maxLength)
throw new SimpleException('Source must have at most %d characters', $maxLength);