From 4a2ab4740c86c53615013ca27dfc730ea66c5e2d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 2 Mar 2021 14:26:10 +0100 Subject: [PATCH] JavaScript: Enhance `DEFINE_RE` to broaden supported syntaxes --- library/Icinga/Web/JavaScript.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 00d970e30..173c179e1 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -12,7 +12,8 @@ use JShrink\Minifier; class JavaScript { /** @var string */ - const DEFINE_RE = '/(?)/'; + const DEFINE_RE = + '/(?function\s*\([^)]*\)|[^=]*=>|\w+).*)/'; protected static $jsFiles = [ 'js/helpers.js',