Skip to content

Commit

Permalink
Fixed PHP TypeError when no coordinates are set.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hipska committed Jan 19, 2023
1 parent cae1e14 commit 9da0028
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.8.1 - 2023-01-19
### Fixed
- PHP TypeError when no coordinates are set.

## 1.8.0 - 2022-10-27
### Added
- Improved support with [Location hierarchy](https://www.itophub.io/wiki/page?id=extensions:combodo-location-hierarchy) extension.
Expand Down
4 changes: 2 additions & 2 deletions main.sv-geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function GetSQLValues($value)
}

/**
* @param string|ormGeolocation $proposedValue
* @param null|string|ormGeolocation $proposedValue
* @param DBObject $oHostObj
* @return ormGeolocation
*/
Expand Down Expand Up @@ -371,7 +371,7 @@ public static function getRijksdriehoekReference()
* @param string $sInput
* @return static
*/
public static function fromString(string $sInput)
public static function fromString(?string $sInput)
{
if (preg_match('{^([-+]?(?:[1-8]?\d(?:\.\d+)?|90(?:\.0+)?)),\s*([-+]?(?:180(?:\.0+)?|(?:(?:1[0-7]\d)|(?:[1-9]?\d))(?:\.\d+)?))$}', trim($sInput), $aMatches))
{
Expand Down
2 changes: 1 addition & 1 deletion module.sv-geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SetupWebPage::AddModule(
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
'sv-geolocation/1.8.0',
'sv-geolocation/1.8.1',
array(
// Identification
//
Expand Down

0 comments on commit 9da0028

Please sign in to comment.