diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index deff4a4f9c..3972b77ed0 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -1032,8 +1032,8 @@ public function hexColorToRGBA(string $text, float $opacity = 1): string if (is_null($col)) { return $text; } - preg_match_all("/[0-9A-Fa-f]{2}/", $col, $m); - if (!count($m)) { + $ret = preg_match_all("/[0-9A-Fa-f]{2}/", $col, $m); + if (!($ret && count($m[0]))) { return $text; } diff --git a/webapp/tests/Unit/Controller/Jury/JuryMiscControllerTest.php b/webapp/tests/Unit/Controller/Jury/JuryMiscControllerTest.php index 31e9b0bf89..bda8ae8583 100644 --- a/webapp/tests/Unit/Controller/Jury/JuryMiscControllerTest.php +++ b/webapp/tests/Unit/Controller/Jury/JuryMiscControllerTest.php @@ -91,7 +91,7 @@ public function testBalloonScoreboard(array $fixtures, bool $public, string $con $elements = ["3 tries",'Demo contest','Utrecht University']; } elseif (in_array($contestStage, ['preEnd','preUnfreeze'])) { $elements = ["0 + 4 tries","3 tries","2 + 1 tries",'Demo contest','Utrecht University']; - if ($contestStage === 'preFreeze') { + if ($contestStage === 'preUnfreeze') { $elements[] = 'contest over, waiting for results'; } } else {