Skip to content

Commit 3fc66ec

Browse files
JeroenDeDauwmalberts
authored andcommitted
Ignore GeoJSON description objects
1 parent 5795443 commit 3fc66ec

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Not released yet.
99

1010
* Raised the minimum MediaWiki version from 1.35 to 1.40
1111
* Added compatibility with MediaWiki 1.44
12+
* Fixed GeoJSON error by ignoring GeoJSON descriptions that are objects
1213

1314
## Maps 11.0.1
1415

src/GeoJsonPages/Semantic/SubObjectBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ private function pointToSubobject( Point $point, array $properties ): SubObject
4848
new \SMWDIGeoCoord( $point->getCoordinates()[1], $point->getCoordinates()[0] )
4949
);
5050

51-
if ( array_key_exists( 'description', $properties ) ) {
51+
if ( array_key_exists( 'description', $properties ) && is_string( $properties['description'] ) ) {
5252
$subObject->addPropertyValuePair(
5353
'HasDescription',
5454
new \SMWDIBlob( $properties['description'] )
5555
);
5656
}
5757

58-
if ( array_key_exists( 'title', $properties ) ) {
58+
if ( array_key_exists( 'title', $properties ) && is_string( $properties['title'] ) ) {
5959
$subObject->addPropertyValuePair(
6060
'HasTitle',
6161
new \SMWDIBlob( $properties['title'] )

0 commit comments

Comments
 (0)