Have CommentStore limit the maximum character length of comments
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 10 Oct 2017 15:52:13 +0000 (11:52 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 11 Oct 2017 00:59:52 +0000 (20:59 -0400)
commit5c228f5a18c068452fcec9e892913e50faa37198
tree36a7fbe39586b7afec323477ab52267da5a8ff13
parent63752d25bfc28159f5f9b6a2e9a6a6d784959fd0
Have CommentStore limit the maximum character length of comments

I92954c9 accidentally allowed comments, when CommentStore is enabled, to
be the full 65535 bytes available in the database field. This was never
intended.

There is not yet any consensus in T6714 or T6715 on just how long the
longer comments should be, for now we'll set 1000 because Tim says so.
Note this doesn't change the UI to actually allow more characters and
will only take effect once $wgCommentTableSchemaMigrationStage is raised
above MIGRATION_OLD.

Note this also doesn't make the limit configurable. That too can be done
later if needed, again along with whatever changes are necessary to the
UI to account for a variable limit.

Change-Id: I7e0c55619210ebab467436f0bb915271c0a7ccdc
includes/CommentStore.php
tests/phpunit/includes/CommentStoreTest.php