From 6ce0e36b18a179423f0b34f5f21610411a13430a Mon Sep 17 00:00:00 2001
From: Brad Jorsch <bjorsch@wikimedia.org>
Date: Mon, 25 Apr 2016 08:21:07 -0700
Subject: [PATCH] SECURITY: Check for mbstring.func_overload at runtime

The installer already checks for this, let's also catch the case when
someone enables this after installation.

Bug: T122807
Change-Id: Ieddbc932f482d52da1688d472f494074c81124b2
---
 includes/WebStart.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/includes/WebStart.php b/includes/WebStart.php
index 2c41706..e8dd6fe 100644
--- a/includes/WebStart.php
+++ b/includes/WebStart.php
@@ -60,6 +60,10 @@ if ( ini_get( 'register_globals' ) ) {
 	}
 }
 
+if ( ini_get( 'mbstring.func_overload' ) ) {
+       die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
+}
+
 # bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this
 # We're adding it here so that it's *always* set, even for alternate entry
 # points and when $wgOut gets disabled or overridden.
-- 
2.6.6

