From 32d9c3b7905f4e43ffdf4bf2bf37723cfd18390c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 2 Sep 2018 13:19:58 +0200 Subject: Use mb_strcut (#1996) * Use mb_strcut Avoid cutting in the middle of a multi-byte UTF-8 character * Forgotten php5-* * Typo * Whitespace * More mb_strcut --- app/Models/Entry.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 2b6059638..ccbad5724 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -31,6 +31,7 @@ class FreshRSS_Entry extends Minz_Model { $this->_isRead($is_read); $this->_isFavorite($is_favorite); $this->_feedId($feedId); + $tags = mb_strcut($tags, 0, 1023, 'UTF-8'); $this->_tags(preg_split('/[\s#]/', $tags)); $this->_guid($guid); } @@ -123,11 +124,11 @@ class FreshRSS_Entry extends Minz_Model { } public function _title($value) { $this->hash = null; - $this->title = $value; + $this->title = mb_strcut($value, 0, 255, 'UTF-8'); } public function _author($value) { $this->hash = null; - $this->author = $value; + $this->author = mb_strcut($value, 0, 255, 'UTF-8'); } public function _content($value) { $this->hash = null; -- cgit v1.2.3