2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

01_FHEMWEB.pm: fixing websocket crash on UTF-8 data (Forum #125866)

git-svn-id: https://svn.fhem.de/fhem/trunk@25631 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-02-05 10:10:43 +00:00
parent fed7018708
commit 9c4e4f5b0f

View File

@ -715,6 +715,7 @@ FW_addToWritebuffer($$@)
{
my ($hash, $txt, $callback, $nolimit) = @_;
utf8::encode($txt) if(utf8::is_utf8($txt) && $txt =~ m/[^\x00-\xFF]/ );
if( $hash->{websocket} ) {
my $len = length($txt);
if( $len < 126 ) {