diff --git a/core/imageboard/tag.php b/core/imageboard/tag.php index 1f6bc6f8..fab6b1f2 100644 --- a/core/imageboard/tag.php +++ b/core/imageboard/tag.php @@ -210,9 +210,6 @@ class Tag $tag = ""; } // 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; } diff --git a/ext/post_tags/main.php b/ext/post_tags/main.php index ed332718..ff21433c 100644 --- a/ext/post_tags/main.php +++ b/ext/post_tags/main.php @@ -141,6 +141,7 @@ class PostTags extends Extension } else { $page->flash($e->getMessage()); } + throw $e; } } } diff --git a/ext/post_tags/test.php b/ext/post_tags/test.php index 583af312..885d68d1 100644 --- a/ext/post_tags/test.php +++ b/ext/post_tags/test.php @@ -42,8 +42,8 @@ class PostTagsTest extends ShimmiePHPUnitTestCase public function testTagEdit_tooLong(): void { $this->log_in_as_user(); - $image_id = $this->post_image("tests/pbx_screenshot.jpg", str_repeat("a", 500)); - $this->get_page("post/view/$image_id"); - $this->assert_title("Post $image_id: tagme"); + $this->assertException(TagSetException::class, function () { + $this->post_image("tests/pbx_screenshot.jpg", str_repeat("a", 500)); + }); } }