Skip to content

Commit 75671e4

Browse files
author
Trey Hyde
committed
strlen is not a portable way of requesting the count of bytes in a PHP string.
1 parent 29f6e4c commit 75671e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/CentralDesktop/Stomp/Connection.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,9 @@ function _writeFrame(Frame $stompFrame, $reconnect = true) {
557557

558558
$data = $stompFrame->__toString();
559559

560-
$this->logger->debug("Sending Frame", $frame->headers);
561-
562-
$r = fwrite($this->_socket, $data, strlen($data));
560+
$this->logger->debug("Sending Frame", $stompFrame->headers);
563561

562+
$r = fwrite($this->_socket, $data, mb_strlen($data, '8bit'));
564563
if (($r === false || $r == 0) && $reconnect) {
565564
$this->_reconnect();
566565
$this->_writeFrame($stompFrame);

0 commit comments

Comments
 (0)