From 6d407132f12c67d081d4d0f2ca97a20e357c1592 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 16 Sep 2023 14:29:07 +0200 Subject: [PATCH] Trim the description of a style package to 255 characters See https://www.woltlab.com/community/thread/301562-fehler-bei-zu-langem-text-in-der-stilbeschreibung/ --- wcfsetup/install/files/lib/data/style/StyleEditor.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 704e3c8eaf..1ba83ab8b4 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -1176,6 +1176,10 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO // description foreach ($styleDescriptions as $languageCode => $value) { + // The description of a style is effectively stored in a TEXT column + // but packages use a VARCHAR(255) to store it. + $value = \mb_substr($value, 0, 255); + $xml->writeElement('packagedescription', $value, ['language' => $languageCode]); } -- 2.20.1