From 3dc69de9d31612e6fe45e2755deb3605ce94dc5e Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Wed, 5 Feb 2014 23:06:49 -0500 Subject: [PATCH] Enforce UTF-8 in App (disallow mbstring.func_overload) --- src/Ratchet/App.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ratchet/App.php b/src/Ratchet/App.php index 0b151b0..99deb4e 100644 --- a/src/Ratchet/App.php +++ b/src/Ratchet/App.php @@ -59,6 +59,10 @@ class App { trigger_error("XDebug extension detected. Remember to disable this if performance testing or going live!", E_USER_WARNING); } + if (3 !== strlen('✓')) { + throw new \DomainException('Bad encoding, length of unicode character ✓ should be 3. Ensure charset UTF-8 and check ini val mbstring.func_autoload'); + } + if (null === $loop) { $loop = LoopFactory::create(); }