From 45448132556bce6211635a4c1c3d336826b6137e Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Sun, 1 Nov 2020 18:26:16 +0100 Subject: [PATCH] Remove the leading `#` in the color command Starting with PHP 7.4 passing invalid characters to `hexdec` generates a deprecation notice. --- files_wcf/js/Bastelstu.be/Chat/Command/Color.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files_wcf/js/Bastelstu.be/Chat/Command/Color.js b/files_wcf/js/Bastelstu.be/Chat/Command/Color.js index 93399e7..a9173c9 100644 --- a/files_wcf/js/Bastelstu.be/Chat/Command/Color.js +++ b/files_wcf/js/Bastelstu.be/Chat/Command/Color.js @@ -18,7 +18,10 @@ define(['../Command', '../Parser'], function (Command, Parser) { getParameterParser() { // Either match a color in hexadecimal RGB notation or a color name (just letters) const color = Parser.F.try( - Parser.RGBHex.map((color) => ({ type: 'hex', value: color })) + Parser.RGBHex.map((color) => ({ + type: 'hex', + value: color.replace(/^#/, ''), + })) ).or(new Parser.X().word().map((word) => ({ type: 'word', value: word }))) // Either match a single color or two colors separated by a space