From 170ebfb849676f649d1961ea2d49a67333ae8cf8 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Wed, 10 Nov 2010 16:45:28 +0000 Subject: [PATCH] Added a check for PCRE_UTF8 per report at Support desk --- includes/installer/Installer.i18n.php | 2 ++ includes/installer/Installer.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index f50eb9cecd..eb74646606 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -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 memory_limit', 'config-memory-ok' => "PHP's memory_limit is $1. OK.", diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 89eb511282..1bfc4c5c49 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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; + } } /** -- 2.20.1