[core] don't limit searchable tag length, only writable length, fixes #1087

This commit is contained in:
Shish 2024-02-24 17:34:51 +00:00 committed by Shish
parent aeeccf31d5
commit 2f4d8572b7
3 changed files with 4 additions and 6 deletions

View file

@ -210,9 +210,6 @@ class Tag
$tag = ""; $tag = "";
} // hard-code one bad case... } // hard-code one bad case...
if (mb_strlen($tag, 'UTF-8') > 255) {
throw new InvalidInput("The tag below is longer than 255 characters, please use a shorter tag.\n$tag\n");
}
return $tag; return $tag;
} }

View file

@ -141,6 +141,7 @@ class PostTags extends Extension
} else { } else {
$page->flash($e->getMessage()); $page->flash($e->getMessage());
} }
throw $e;
} }
} }
} }

View file

@ -42,8 +42,8 @@ class PostTagsTest extends ShimmiePHPUnitTestCase
public function testTagEdit_tooLong(): void public function testTagEdit_tooLong(): void
{ {
$this->log_in_as_user(); $this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", str_repeat("a", 500)); $this->assertException(TagSetException::class, function () {
$this->get_page("post/view/$image_id"); $this->post_image("tests/pbx_screenshot.jpg", str_repeat("a", 500));
$this->assert_title("Post $image_id: tagme"); });
} }
} }