Page MenuHomePhabricator

Language::isMultibyte() doesn't work with language code fr
Closed, DeclinedPublic

Description

Author: loustyx

Description:
This bug appeares with r16114 (U languages/Language.php).
Page (such that
http://127.0.0.1/wiki/Cat%C3%A9gorie:Mod%C3%A8le
http://127.0.0.1/wiki/Mod%C3%A8le:M
) with accentuated character in namespace (for language code fr) no longer
exists. But template still works.


Version: 1.8.x
Severity: critical
OS: Windows XP
Platform: PC

Details

Reference
bz7160

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:25 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz7160.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Please link to a page where this bug is exhibited, and please describe the
problem more precisely. http://fr.wikipedia.org/wiki/Cat%C3%A9gorie:Mod%C3%A8le
shows up correctly for me, as do the templates and categories I went to from
there. What do you mean, page no longer exists?

loustyx wrote:

version:

  1. MediaWiki: 1.8alpha (r16257)
  2. PHP: 5.1.4 (apache)
  3. MySQL: 4.1.9-max

This bug is resolved when I restore the "^" in function isMultibyte :

function isMultibyte( $str ) {

		return (bool)preg_match( '/^[\x80-\xff]/', $str );

}

Of course, these pages still exist in the database, but I can't get such pages.
I get message (that is 'noarticletext') :
"Il n'y a pour l'instant aucun texte sur cette page, vous pouvez faire une
recherche pour le titre de cette page ou modifier cette page"

May be, fr.wikipedia.org uses a different OS (encoding problems often depend on OS).

loustyx wrote:

templates still work but "[[Catégorie:Physique]]" creates a red link.

ayg wrote:

Is this on Wikimedia Foundation projects, or only on your local installation?
What OS are you using, and is the mbstring extension installed in your copy of PHP?

loustyx wrote:

local installation
OS: Windows XP

php.ini:
[mbstring]
;empty. nothing is uncommented.
;PHPExt
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_mysql.dll