Page MenuHomePhabricator

Increase title length
Open, Needs TriagePublic

Description

We've seen the issues before where article text isn't big enough (mostly due to soft limits in MediaWiki via https://www.mediawiki.org/wiki/Manual:$wgMaxArticleSize e.g. T275319: Change $wgMaxArticleSize limit from byte-based to character-based/T308893: Increase $wgMaxArticleSize to 4MB for ruwikisource).

But similar issues apply to page titles, to larger extents in some languages than others. Especially as newer character sets keep getting added (and emojis)

CREATE TABLE /*_*/page (
  page_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  page_namespace INT NOT NULL,
  page_title VARBINARY(255) NOT NULL,

(Plus searchindex.si_title, linktarget.lt_title, redirect.rd_title, pagelinks.pl_title, langlinks.ll_title, iwlinks.iwl_title, category.cat_title and anywhere else we store the full page title... Then Wikibase stuff too)

This was highlighted in T325650: Cannot create translated category if its name is >255 bytes in UTF-8.

The requested page title is too long. It must be no longer than 255 bytes in UTF-8 encoding.
php > var_dump( mb_strlen( 'ဝေ\U+102Bဟာအဝ\U+103Aဃ\U+103E\U+1033ယ\U+103Bာနေတ\U+103A-အခိုက\U+103Aက\U+105Eာဂ\U+103Dံလဝ\U+103Aအာဲက\U+105Fာဲနူဝေ\U+102Bဟာမာလာယဝ\U+103A-ပဝ\U+103Aလ\U+1033န\U+1033ဃ\U+103Eေန\U+103A လ္ပာ\U+103Aဖာဗ\U+105Fံက\U+103A-အခိုက\U+103Aက\U+105Eာဂမ\U+1060ိုင\U+103A' ) );
int(98)

php > var_dump( strlen( 'ဝေ\U+102Bဟာအဝ\U+103Aဃ\U+103E\U+1033ယ\U+103Bာနေတ\U+103A-အခိုက\U+103Aက\U+105Eာဂ\U+103Dံလဝ\U+103Aအာဲက\U+105Fာဲနူဝေ\U+102Bဟာမာလာယဝ\U+103A-ပဝ\U+103Aလ\U+1033န\U+1033ဃ\U+103Eေန\U+103A လ္ပာ\U+103Aဖာဗ\U+105Fံက\U+103A-အခိုက\U+103Aက\U+105Eာဂမ\U+1060ိုင\U+103A' ));
int(286)

98 visual characters, but 286 bytes; meaning the characters are 3 bytes (plus the spaces).