[WebSocket] Encoding bug fix
In the handshake verifier, make sure we're checking byte length, not string length
This commit is contained in:
parent
7d9db7c377
commit
b9144b3b82
@ -104,7 +104,7 @@ class HandshakeVerifier {
|
|||||||
* @todo The spec says we don't need to base64_decode - can I just check if the length is 24 and not decode?
|
* @todo The spec says we don't need to base64_decode - can I just check if the length is 24 and not decode?
|
||||||
*/
|
*/
|
||||||
public function verifyKey($val) {
|
public function verifyKey($val) {
|
||||||
return (16 === strlen(base64_decode((string)$val)));
|
return (16 === mb_strlen(base64_decode((string)$val), '8bit'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user