Skip to content

Commit

Permalink
Fix return type in getCurrentLinkForSite()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Mar 24, 2023
1 parent 9d95574 commit bd5992c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# GeoMate Changelog

## 2.1.1 - 2023-03-24
### Fixed
- Fixed a bug that could result in a PHP exception if a site link ended up being `null`. Fixes #58

## 2.1.0 - 2022-10-04
### Changed
- Auto-redirects based on browser language now always work, regardless of GeoMate having access to a geolocation database or not. #53
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vaersaagod/geomate",
"description": "GeoMate is a friend in need for all things geolocation. IP to geo lookup, automatic redirects (based on country, continent, language, etc), site switcher... You name it.",
"version": "2.1.0",
"version": "2.1.1",
"type": "craft-plugin",
"keywords": [
"craft",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/GeoMateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function getSiteLinks(): array
return $r;
}

public static function getCurrentLinkForSite(Site $site, bool $elementMatchOnly = false): bool|string
public static function getCurrentLinkForSite(Site $site, bool $elementMatchOnly = false): bool|null|string
{
// Get the site URL for the found site, this will be the fallback if we're not on an element's url
$url = $elementMatchOnly ? null : $site->getBaseUrl();
Expand Down

0 comments on commit bd5992c

Please sign in to comment.