diff --git a/Puc/v5p0/Vcs/GitHubApi.php b/Puc/v5p0/Vcs/GitHubApi.php index 940c7ac..c8bd429 100644 --- a/Puc/v5p0/Vcs/GitHubApi.php +++ b/Puc/v5p0/Vcs/GitHubApi.php @@ -114,7 +114,7 @@ if ( !class_exists(GitHubApi::class, false) ): if ( $this->releaseAssetsEnabled ) { //Use the first release asset that matches the specified regular expression. if ( isset($release->assets, $release->assets[0]) ) { - $matchingAssets = array_filter($release->assets, array($this, 'matchesAssetFilter')); + $matchingAssets = array_values(array_filter($release->assets, array($this, 'matchesAssetFilter'))); } else { $matchingAssets = array(); } @@ -358,7 +358,7 @@ if ( !class_exists(GitHubApi::class, false) ): protected function getUpdateDetectionStrategies($configBranch) { $strategies = array(); - if ( $configBranch === 'master' ) { + if ( $configBranch === 'master' || $configBranch === 'main') { //Use the latest release. $strategies[self::STRATEGY_LATEST_RELEASE] = array($this, 'getLatestRelease'); //Failing that, use the tag with the highest version number.