Merge pull request #5574 from annando/issue-5436

Issue 5436: Don't store tags that are too long
This commit is contained in:
Tobias Diekershoff 2018-08-06 19:19:22 +02:00 committed by GitHub
commit c5040f4daa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1471,8 +1471,10 @@ class PortableContact
$tags = []; $tags = [];
foreach ($data['tags'] as $tag) { foreach ($data['tags'] as $tag) {
$tag = mb_strtolower($tag); $tag = mb_strtolower($tag);
if (count($tag) < 100) {
$tags[$tag] = $tag; $tags[$tag] = $tag;
} }
}
foreach ($tags as $tag) { foreach ($tags as $tag) {
DBA::insert('gserver-tag', ['gserver-id' => $gserver['id'], 'tag' => $tag], true); DBA::insert('gserver-tag', ['gserver-id' => $gserver['id'], 'tag' => $tag], true);