fixes #2142 truncate tags_strings if longer than 50 chars

This commit is contained in:
plegall
2024-03-31 17:08:54 +02:00
parent 3433972fe0
commit 929bd1bd73

View File

@@ -452,6 +452,14 @@ UPDATE '.USER_INFOS_TABLE.'
if ('tags'==@$page['section'])
{
$tags_string = implode(',', $page['tag_ids']);
if (strlen($tags_string) > 50)
{
// we need to truncate, mysql won't accept a too long string
$tags_string = substr($tags_string, 0, 50);
// the last tag_id may have been truncated itself, so we must remove it
$tags_string = substr($tags_string, 0, strrpos($tags_string, ','));
}
}
$ip = $_SERVER['REMOTE_ADDR'];