feat: Added reverse-only-search validation

This commit is contained in:
Darkshredder
2021-05-13 03:14:37 +05:30
parent d7f9d2bde9
commit e5ffc59cd5
7 changed files with 49 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
<?php
require_once(CONST_LibDir.'/init-website.php');
require_once(CONST_LibDir.'/ParameterParser.php');
$oParams = new Nominatim\ParameterParser();
// Format for output
$sOutputFormat = $oParams->getSet('format', array('xml', 'json', 'jsonv2', 'geojson', 'geocodejson'), 'jsonv2');
set_exception_handler_by_format($sOutputFormat);
throw new Exception('Reverse-only import does not support forward searching.', 404);