diff --git a/funcs.php b/funcs.php index 1411eef..428379b 100644 --- a/funcs.php +++ b/funcs.php @@ -60,7 +60,9 @@ function branches( } if (!$version) { $version = preg_replace('#[^0-9\.]#', '', $json->require->{'silverstripe/assets'} ?? ''); - $matchedOnBranchThreeLess = true; + if ($version) { + $matchedOnBranchThreeLess = true; + } } if (!$version) { $version = preg_replace('#[^0-9\.]#', '', $json->require->{'cwp/starter-theme'} ?? ''); diff --git a/tests/BranchesTest.php b/tests/BranchesTest.php index e633f5b..eb1a878 100644 --- a/tests/BranchesTest.php +++ b/tests/BranchesTest.php @@ -357,6 +357,10 @@ public function provideBranches() EOT, 'branchesJson' => <<