From 2ecebd14b02ec1cbca2fe7aa99b4302563d6103d Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 10 Sep 2015 12:49:38 -0600 Subject: [PATCH] added check for mbstring support --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.php b/index.php index 9379b7637..3220f22c5 100644 --- a/index.php +++ b/index.php @@ -19,6 +19,12 @@ $loader = require_once $autoload; // Set timezone to default, falls back to system if php.ini not set date_default_timezone_set(@date_default_timezone_get()); +// Set internal encoding if mbstring loaded +if (!extension_loaded('mbstring')) { + throw new \RuntimeException("'mbstring' extension is not loaded. This is required for Grav to run correctly"); +} +mb_internal_encoding('UTF-8'); + // Get the Grav instance $grav = Grav::instance( array(