mirror of
https://github.com/netzmacht/contao-leaflet-geocode-widget.git
synced 2026-02-28 09:08:14 +01:00
Fix error handling.
This commit is contained in:
@@ -63,13 +63,13 @@ class GeocodeWidget extends \Widget
|
|||||||
if (
|
if (
|
||||||
// See: http://stackoverflow.com/a/18690202
|
// See: http://stackoverflow.com/a/18690202
|
||||||
!preg_match(
|
!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
|
$value
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$this->addError(
|
$this->addError(
|
||||||
sprintf(
|
sprintf(
|
||||||
$GLOBALS['TL_LANG']['ERR']['leaflet_invalid_coordinate'],
|
$GLOBALS['TL_LANG']['ERR']['leafletInvalidCoordinate'],
|
||||||
$value
|
$value
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -92,6 +92,7 @@ class GeocodeWidget extends \Widget
|
|||||||
'value' => specialchars($this->value),
|
'value' => specialchars($this->value),
|
||||||
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
'class' => $this->strClass ? ' ' . $this->strClass : '',
|
||||||
'id' => $this->strId,
|
'id' => $this->strId,
|
||||||
|
'name' => $this->strName,
|
||||||
'attributes' => $this->getAttributes(),
|
'attributes' => $this->getAttributes(),
|
||||||
'wizard' => $this->wizard,
|
'wizard' => $this->wizard,
|
||||||
'label' => $this->strLabel
|
'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']['leafletSearchPositionLabel'] = 'Suchen';
|
||||||
$GLOBALS['TL_LANG']['MSC']['leafletApplyPositionLabel'] = 'Übernehmen';
|
$GLOBALS['TL_LANG']['MSC']['leafletApplyPositionLabel'] = 'Übernehmen';
|
||||||
|
|||||||
Reference in New Issue
Block a user