mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
ConsoleReaderThread: trim the string before returning it
it will have a newline at the end that was added by the subprocess when posting it to the main process.
This commit is contained in:
@@ -39,6 +39,7 @@ use function stream_socket_accept;
|
|||||||
use function stream_socket_get_name;
|
use function stream_socket_get_name;
|
||||||
use function stream_socket_server;
|
use function stream_socket_server;
|
||||||
use function stream_socket_shutdown;
|
use function stream_socket_shutdown;
|
||||||
|
use function trim;
|
||||||
use const PHP_BINARY;
|
use const PHP_BINARY;
|
||||||
use const STREAM_SHUT_RDWR;
|
use const STREAM_SHUT_RDWR;
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ final class ConsoleReaderThread extends Thread{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$buffer[] = preg_replace("#\\x1b\\x5b([^\\x1b]*\\x7e|[\\x40-\\x50])#", "", $command);
|
$buffer[] = preg_replace("#\\x1b\\x5b([^\\x1b]*\\x7e|[\\x40-\\x50])#", "", trim($command));
|
||||||
if($notifier !== null){
|
if($notifier !== null){
|
||||||
$notifier->wakeupSleeper();
|
$notifier->wakeupSleeper();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user