diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2022-05-13 11:36:52 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2022-05-13 11:36:52 +0000 |
| commit | 37070aef62dd9ed14682a7fdbbde785a1175bb01 (patch) | |
| tree | ad9887b0ed20e322bbf357dd6de9b8925b3144fd /lib/resources | |
| parent | 779f2da25a832caaf64928b309368568c04e1f61 (diff) | |
no default values are saved for geo-coordinates, closes #871
Closes #871, #1055, and #1046
Merge request studip/studip!607
Diffstat (limited to 'lib/resources')
| -rw-r--r-- | lib/resources/ResourceManager.class.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/resources/ResourceManager.class.php b/lib/resources/ResourceManager.class.php index bb1cca4..e0d9466 100644 --- a/lib/resources/ResourceManager.class.php +++ b/lib/resources/ResourceManager.class.php @@ -564,14 +564,11 @@ class ResourceManager //- altitude: up to 5 digits, decimal point, 1 to 10 digits for fraction //before the decimal point. After the decimal point, //In that case it is a coordinate format we can parse: - if(!preg_match( ResourcePropertyDefinition::CRSWGS84_REGEX, $coordinate_string )) { - throw new ResourcePropertyStateException( - _('Die Positionsangabe kann nicht umgewandelt werden, da sie ungültige Daten enthält!') - ); + PageLayout::postError(_('Die Positionsangabe kann nicht umgewandelt werden, da sie ungültige Daten enthält!')); } //With the first split we separate the numbers in the coordinate string. @@ -590,7 +587,7 @@ class ResourceManager //with decimal separators. $coordinate_signs = preg_split( - '/\.[0-9]{1,10}/', + '/\.\d{1,10}/', $coordinate_string, -1, PREG_SPLIT_NO_EMPTY @@ -690,6 +687,7 @@ class ResourceManager ) { $coordinate_parts = []; + $string = ''; try { $coordinate_parts = self::getPositionArray($property); } catch (ResourcePropertyDefinitionException $e) { |
