mirror of
https://github.com/kevachat/npsapp.git
synced 2025-01-29 16:24:17 +00:00
add message encoding validation
This commit is contained in:
parent
67c3c24744
commit
5427b135d5
@ -109,6 +109,10 @@
|
|||||||
[
|
[
|
||||||
"\u001b[31mMessage could not be empty!\u001b[0m"
|
"\u001b[31mMessage could not be empty!\u001b[0m"
|
||||||
],
|
],
|
||||||
|
"encoding":
|
||||||
|
[
|
||||||
|
"\u001b[31mInvalid message encoding!\u001b[0m"
|
||||||
|
],
|
||||||
"internal":
|
"internal":
|
||||||
[
|
[
|
||||||
"\u001b[31mSomething went wrong, please make your feedback!\u001b[0m",
|
"\u001b[31mSomething went wrong, please make your feedback!\u001b[0m",
|
||||||
|
@ -194,6 +194,17 @@ class Ratchet implements MessageComponentInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check message encoding valid
|
||||||
|
else if (!mb_check_encoding($connection->message, 'UTF-8'))
|
||||||
|
{
|
||||||
|
$connection->send(
|
||||||
|
implode(
|
||||||
|
PHP_EOL,
|
||||||
|
$config->response->submit->failure->encoding
|
||||||
|
) . PHP_EOL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Max length already checked on input, begin message save
|
// Max length already checked on input, begin message save
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user