Skip to content

Commit

Permalink
[core] don't limit searchable tag length, only writable length, fixes s…
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Feb 24, 2024
1 parent aeeccf3 commit 2f4d857
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions core/imageboard/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions ext/post_tags/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function onImageInfoSet(ImageInfoSetEvent $event): void
} else {
$page->flash($e->getMessage());
}
throw $e;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions ext/post_tags/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}
}

0 comments on commit 2f4d857

Please sign in to comment.