mirror of
https://github.com/netzmacht/contao-leaflet-geocode-widget.git
synced 2026-02-28 00:58:15 +01:00
Fix error handling.
This commit is contained in:
@@ -63,13 +63,13 @@ class GeocodeWidget extends \Widget
|
||||
if (
|
||||
// See: http://stackoverflow.com/a/18690202
|
||||
!preg_match(
|
||||
'^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)(,[-+]?\d+)?$',
|
||||
'#^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)(,[-+]?\d+)?$#',
|
||||
$value
|
||||
)
|
||||
) {
|
||||
$this->addError(
|
||||
sprintf(
|
||||
$GLOBALS['TL_LANG']['ERR']['leaflet_invalid_coordinate'],
|
||||
$GLOBALS['TL_LANG']['ERR']['leafletInvalidCoordinate'],
|
||||
$value
|
||||
)
|
||||
);
|
||||
@@ -92,6 +92,7 @@ class GeocodeWidget extends \Widget
|
||||
'value' => specialchars($this->value),
|
||||
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
||||
'id' => $this->strId,
|
||||
'name' => $this->strName,
|
||||
'attributes' => $this->getAttributes(),
|
||||
'wizard' => $this->wizard,
|
||||
'label' => $this->strLabel
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
$GLOBALS['TL_LANG']['ERR']['leaflet_invalid_coordinate'] = 'Die angegebenen Koordinaten sind ungültig.';
|
||||
$GLOBALS['TL_LANG']['ERR']['leafletInvalidCoordinate'] = 'Die angegebenen Koordinaten sind ungültig.';
|
||||
$GLOBALS['TL_LANG']['MSC']['leafletSearchPositionLabel'] = 'Suchen';
|
||||
$GLOBALS['TL_LANG']['MSC']['leafletApplyPositionLabel'] = 'Übernehmen';
|
||||
|
||||
Reference in New Issue
Block a user