Skip to content

Commit 6e02758

Browse files
author
amkushmantsev
committed
#hotfix: Fix method type detection on dynamic call of RFC web-socket supported methods
1 parent b331cf2 commit 6e02758

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/WebSocketServer.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ private function messagesWorker(array $readSocks)
216216
continue;
217217
}
218218

219-
if (method_exists($this->handler, self::MAP_EVENT_TYPE_TO_METHODS[$dataType])) {
219+
$isSupportedMethod = empty(self::MAP_EVENT_TYPE_TO_METHODS[$dataType]) === false
220+
&& method_exists($this->handler, self::MAP_EVENT_TYPE_TO_METHODS[$dataType]);
221+
if ($isSupportedMethod) {
220222
try {
221223
// dynamic call: onMessage, onPing, onPong
222224
$this->handler->{self::MAP_EVENT_TYPE_TO_METHODS[$dataType]}($this->cureentConn, $dataPayload);

0 commit comments

Comments
 (0)