From 1600589793ec1f658d639de419a32279187768e6 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 6 May 2014 11:28:24 +0200 Subject: [PATCH] Moved max post source length to config --- data/config.ini | 3 +++ src/Models/PostModel.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data/config.ini b/data/config.ini index 660cdbf9..0197164a 100644 --- a/data/config.ini +++ b/data/config.ini @@ -39,6 +39,9 @@ showDislikedPostsDefault=1 maxSearchTokens=4 maxRelatedPosts=50 +[posts] +maxSourceLength = 200 + [comments] minLength = 5 maxLength = 2000 diff --git a/src/Models/PostModel.php b/src/Models/PostModel.php index 9ed0701a..e812d6b0 100644 --- a/src/Models/PostModel.php +++ b/src/Models/PostModel.php @@ -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);