Added a check for PCRE_UTF8 per report at Support desk
authorMax Semenik <maxsem@users.mediawiki.org>
Wed, 10 Nov 2010 16:45:28 +0000 (16:45 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Wed, 10 Nov 2010 16:45:28 +0000 (16:45 +0000)
includes/installer/Installer.i18n.php
includes/installer/Installer.php

index f50eb9c..eb74646 100644 (file)
@@ -124,6 +124,8 @@ MediaWiki requires functions in this module and will not work in this configurat
 If you're running Mandrake, install the php-xml package.",
        'config-pcre'                     => 'The PCRE support module appears to be missing.
 MediaWiki requires the Perl-compatible regular expression functions to work.',
+       'config-pcre-no-utf8'             => "'''Fatal''': PHP's PCRE module seems to be compiled without PCRE_UTF8 support.
+MediaWiki requires UTF-8 support to function correctly.",
        'config-memory-none'              => 'PHP is configured with no <code>memory_limit</code>',
        'config-memory-ok'                => "PHP's <code>memory_limit</code> is $1.
 OK.",
index 89eb511..1bfc4c5 100644 (file)
@@ -536,6 +536,13 @@ abstract class Installer {
                        $this->showMessage( 'config-pcre' );
                        return false;
                }
+               wfSuppressWarnings();
+               $regexd = preg_replace( '/[\x{0400}-\x{04FF}]/u', '', '-АБВГД-' );
+               wfRestoreWarnings();
+               if ( $regexd != '--' ) {
+                       $this->showMessage( 'config-pcre-no-utf8' );
+                       return false;
+               }
        }
 
        /**