From d5a31ceedee5841531f57342266746bb62d7d923 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 5 May 2011 21:53:10 -0700 Subject: Fix for ticket 1275. Do the same checking as Kohana uses and don't worry about calling the utf8_encode routine. Corrected the error messages and also added a check to insure the XML Parser extension is loaded as we still need the utf8_encode function from it. --- installer/installer.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/installer/installer.php b/installer/installer.php index c23d918f..0bef57ae 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -191,8 +191,10 @@ class installer { $errors[] = "Gallery 3 requires a MySQL database, but PHP doesn't have either the MySQL or the MySQLi extension."; } - if (!@preg_match("/^.$/u", utf8_encode("\xF1"))) { - $errors[] = "PHP is missing Perl-Compatible Regular Expression support."; + if (!preg_match("/^.$/u", "ñ")) { + $errors[] = "PHP is missing Perl-Compatible Regular Expression with UTF-8 support."; + } else if (!preg_match("/^\pL$/u", "ñ")) { + $errors[] = "PHP is missing Perl-Compatible Regular Expression with Unicode support."; } if (!(function_exists("spl_autoload_register"))) { @@ -211,6 +213,10 @@ class installer { $errors[] = "PHP is missing the iconv extension"; } + if (!(extension_loaded("xml"))) { + $errors[] = "PHP is missing the XML Parser extension"; + } + if (!(extension_loaded("simplexml"))) { $errors[] = "PHP is missing the SimpleXML extension"; } -- cgit v1.2.3