User "Brion VIBBER" posted a comment on MediaWiki.r86846. Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/86846#c16320 Commit summary:
(bug 16921) Add JavaScript-based enforcing of byte limits on move and protection forms. Patch by Jan Paul Posma Comment: The 180-byte limit seems to be arbitrary; is there a fixed length on the 'other' stuff that goes into the field, or was that just chosen to sound kinda nice? I also recommend against duplicating magic numbers in multiple places like this (once on the maxlength attribute, and again in JS code), as they're likely to get out of sync during future maintenance. It might be most consistent to do something like this: * define a class we can apply to length-limited fields that we know we really have a byte limit for * have common JS apply the byte length limitation on all fields that are so marked, using the maxlength value that's already been specified (and is equal to byte length for the pure-ASCII case, thus always being the upper limit) _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
