Page MenuHomePhabricator

Use CommentStore::COMMENT_CHARACTER_LIMIT everywhere
Open, LowPublic

Description

Comments used to be limited to 255 characters, a value that is hard-coded into multiple automatic edit summary truncation systems. Instead of relying on 225 (or not including a limit at all until the comment is actually saved), CommentStore::COMMENT_CHARACTER_LIMIT should be called instead.

Original proposal:
Could someone please add a global variable (eg $wgTruncatedCommentLength) for specifying the length that long summaries or auto-summaries are truncated to? There's three places in Article.php where this is done in the functions getBlankingAutosummary(), getAutosummary() and the end of delete().

Details

Reference
bz11543

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:59 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz11543.
bzimport added a subscriber: Unknown Object (MLST).
Nad created this task.Oct 2 2007, 9:01 PM
brion added a comment.Oct 2 2007, 11:18 PM

Note that they should all be truncated to the defined field length (255 bytes) fairly consistently, but it wouldn't hurt to use a global var here, per http://c2.com/cgi-bin/wiki?MagicNumber :)

DannyS712 added a subscriber: DannyS712.

The maximum comment length is set at CommentStore::COMMENT_CHARACTER_LIMIT. In cases where the old hardcoded 255 (current is 500) are used, the comment store constant should be retrieved instead. I don't think a full global variable is needed here, since all uses of the limit are based around creating edit summaries and can just retrieve the comment store value. See also T221617

Restricted Application added a project: User-DannyS712. · View Herald TranscriptAug 21 2019, 11:08 PM
DannyS712 renamed this task from Replace hard-wired auto/truncated revision-summary length with a global to Replace hard-wired auto/truncated revision-summary length with CommentStore::COMMENT_CHARACTER_LIMIT.Aug 21 2019, 11:09 PM
DannyS712 updated the task description. (Show Details)
DannyS712 renamed this task from Replace hard-wired auto/truncated revision-summary length with CommentStore::COMMENT_CHARACTER_LIMIT to Use CommentStore::COMMENT_CHARACTER_LIMIT everywhere.Sep 30 2019, 5:49 AM
DannyS712 updated the task description. (Show Details)