From 1de8309008bdacc2440a985b5d91418c4192b22b Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 13 Apr 2020 14:15:04 +0200 Subject: [PATCH] Too long text entries when saving media lead to an error message --- .../install/files/lib/data/media/MediaAction.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/data/media/MediaAction.class.php b/wcfsetup/install/files/lib/data/media/MediaAction.class.php index 57b37f6dc9..2baf5a343f 100644 --- a/wcfsetup/install/files/lib/data/media/MediaAction.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaAction.class.php @@ -347,9 +347,9 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, $statement->execute([ $media->mediaID, $languageID, - isset($this->parameters['title'][$languageID]) ? $this->parameters['title'][$languageID] : '', + isset($this->parameters['title'][$languageID]) ? mb_substr($this->parameters['title'][$languageID], 0, 255) : '', isset($this->parameters['caption'][$languageID]) ? $this->parameters['caption'][$languageID] : '', - isset($this->parameters['altText'][$languageID]) ? $this->parameters['altText'][$languageID] : '' + isset($this->parameters['altText'][$languageID]) ? mb_substr($this->parameters['altText'][$languageID], 0, 255) : '' ]); } else { @@ -374,9 +374,9 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, $statement->execute([ $media->mediaID, $language->languageID, - $title, + mb_substr($title, 0, 255), $caption, - $altText + mb_substr($altText, 0, 255) ]); } } -- 2.20.1