Simetrical wrote:
I was implementing a configuration option to allow
changes to the
maximum length of edit summaries and log reasons, which I've often
felt are inadequate. In doing so, I discovered an issue that needs to
be resolved before I proceed. Basically, when you type stuff in the
form, the input box's maxlength parameter is a maximum number of
*characters*. But when stuff gets validated and put in the database,
it's generally a number of *bytes* that things are truncated to. I've
verified that Firefox will actually permit 200 multibyte characters to
be submitted as an edit summary, when they cannot possibly fit into
the database field.
The current mix of limits between the HTML form field length and DB
field length is known to not be an exact match; it's an approximate
compromise.
There would however *be* no strict need to limit the summary length if
the DB field is expanded -- going from VARCHAR or TINYBLOB out to BLOB
will make pretty much arbitrarily large text possible.
If a limit is still desired, the most sensible thing would simply be to
trim it at whatever huge number of characters you like. This can be done
with the $wgContLang->trim() function on submission.
-- brion vibber (brion @
wikimedia.org)