From b1e9ddc20bbc1a75f7ebb4441cfbae1f58a594b2 Mon Sep 17 00:00:00 2001 From: buddh4 Date: Fri, 19 Feb 2021 10:54:22 +0100 Subject: [PATCH] Fix issue when using deprecated richtext maxLength (#4893) --- CHANGELOG_DEV.md | 6 ++++++ .../content/widgets/richtext/ProsemirrorRichText.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_DEV.md b/CHANGELOG_DEV.md index 461f39cb61..3d3b1832ed 100644 --- a/CHANGELOG_DEV.md +++ b/CHANGELOG_DEV.md @@ -1,3 +1,9 @@ +1.8.0 (Unreleased) +-------------------------------- + +- Fix #4893: Richtext extension events are ignored when using deprecated maxLength option + + 1.8.0-beta.2 (February 18, 2021) -------------------------------- diff --git a/protected/humhub/modules/content/widgets/richtext/ProsemirrorRichText.php b/protected/humhub/modules/content/widgets/richtext/ProsemirrorRichText.php index a4b6c8a852..2da30d5e9f 100644 --- a/protected/humhub/modules/content/widgets/richtext/ProsemirrorRichText.php +++ b/protected/humhub/modules/content/widgets/richtext/ProsemirrorRichText.php @@ -168,7 +168,7 @@ class ProsemirrorRichText extends AbstractRichText // Can be removed in a future version, richtext should not be cut anymore, only text or shorttext version should be cut if ($this->maxLength > 0) { - $output = Helpers::truncateText($this->text, $this->maxLength); + $output = Helpers::truncateText($output, $this->maxLength); } // Wrap encoded output in root div