From 7f41344085d6bab6b602773f09c85534c9ad36cf Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 24 May 2014 19:58:29 +0200
Subject: [PATCH] check mbstring function overloading in installer. closes #736

---
 inc/lang/en/lang.php | 1 +
 install.php          | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 592289185..203c206a8 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -307,6 +307,7 @@ $lang['i_modified']            = 'For security reasons this script will only wor
                                   <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
 $lang['i_funcna']              = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
 $lang['i_phpver']              = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_mbfuncoverload']      = 'mbstring.func_overload must be disabled in php.ini to run DokuWiki.';
 $lang['i_permfail']            = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
 $lang['i_confexists']          = '<code>%s</code> already exists';
 $lang['i_writeerr']            = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
diff --git a/install.php b/install.php
index acc96d3e6..20402d3ff 100644
--- a/install.php
+++ b/install.php
@@ -533,6 +533,11 @@ function check_functions(){
         $ok = false;
     }
 
+    if(ini_get('mbstring.func_overload') != 0){
+        $error[] = $lang['i_mbfuncoverload'];
+        $ok = false;
+    }
+
     $funcs = explode(' ','addslashes call_user_func chmod copy fgets '.
                          'file file_exists fseek flush filesize ftell fopen '.
                          'glob header ignore_user_abort ini_get mail mkdir '.
-- 
GitLab