Update UTF-8 check and move to WsServer

fixes #517
This commit is contained in:
Chris Boden 2017-09-10 11:23:40 -04:00
parent 829af203b2
commit a1a1a3c642
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
CHANGELOG CHANGELOG
========= =========
###Legend ### Legend
* "BC": Backwards compatibility break (from public component APIs) * "BC": Backwards compatibility break (from public component APIs)
* "BF": Bug fix * "BF": Bug fix

View File

@ -65,10 +65,6 @@ class App {
trigger_error('XDebug extension detected. Remember to disable this if performance testing or going live!', E_USER_WARNING); 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) { if (null === $loop) {
$loop = LoopFactory::create(); $loop = LoopFactory::create();
} }

View File

@ -78,6 +78,10 @@ class WsServer implements HttpServerInterface {
throw new \UnexpectedValueException('Expected instance of \Ratchet\WebSocket\MessageComponentInterface or \Ratchet\MessageComponentInterface'); throw new \UnexpectedValueException('Expected instance of \Ratchet\WebSocket\MessageComponentInterface or \Ratchet\MessageComponentInterface');
} }
if (bin2hex('✓') === 'e29c93') {
throw new \DomainException('Bad encoding, length of unicode character ✓ should be 3. Ensure charset UTF-8 and check ini val mbstring.func_autoload');
}
$this->delegate = $component; $this->delegate = $component;
$this->connections = new \SplObjectStorage; $this->connections = new \SplObjectStorage;