diff --git a/core/imageboard/tag.php b/core/imageboard/tag.php index 1f6bc6f8d..fab6b1f2c 100644 --- a/core/imageboard/tag.php +++ b/core/imageboard/tag.php @@ -210,9 +210,6 @@ public static function sanitize(string $tag): string $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 ed3327185..ff21433c5 100644 --- a/ext/post_tags/main.php +++ b/ext/post_tags/main.php @@ -141,6 +141,7 @@ public function onImageInfoSet(ImageInfoSetEvent $event): void } else { $page->flash($e->getMessage()); } + throw $e; } } } diff --git a/ext/post_tags/test.php b/ext/post_tags/test.php index 583af3127..885d68d15 100644 --- a/ext/post_tags/test.php +++ b/ext/post_tags/test.php @@ -42,8 +42,8 @@ public function testInvalidChange(): void 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)); + }); } }