From: Marcel Werk Date: Mon, 13 Apr 2020 12:15:04 +0000 (+0200) Subject: Too long text entries when saving media lead to an error message X-Git-Tag: 3.1.14~27^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1de8309008bdacc2440a985b5d91418c4192b22b;p=GitHub%2FWoltLab%2FWCF.git Too long text entries when saving media lead to an error message --- 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) ]); } }