have tag sanitisation process ignore tags which are too long, fixes #565

This commit is contained in:
Shish
2016-08-29 09:21:23 +01:00
parent 5691d1c3ad
commit bcef3fbc8f
2 changed files with 12 additions and 0 deletions

View File

@ -1102,6 +1102,11 @@ class Tag {
$tag = preg_replace("/^(\.+[\/\\\\])+/", "", $tag); # trailing slashes?
$tag = trim($tag, ", \t\n\r\0\x0B");
if(mb_strlen($tag, 'UTF-8') > 255){
flash_message("The tag below is longer than 255 characters, please use a shorter tag.\n$tag\n");
continue;
}
if(!empty($tag)) {
$tag_array[] = $tag;
}