From: Sarah Hoffmann Date: Tue, 30 Mar 2021 07:33:01 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~173 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/c495ce097916063327460cfa2cc6e3fcccac4df2?hp=-c Merge remote-tracking branch 'upstream/master' --- c495ce097916063327460cfa2cc6e3fcccac4df2 diff --combined CMakeLists.txt index 40140056,6ac81c4f..7c2d7bb3 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -36,6 -36,7 +36,7 @@@ set(BUILD_API on CACHE BOOL "Build ever set(BUILD_MODULE on CACHE BOOL "Build PostgreSQL module") set(BUILD_TESTS on CACHE BOOL "Build test suite") set(BUILD_DOCS on CACHE BOOL "Build documentation") + set(BUILD_MANPAGE on CACHE BOOL "Build Manual Page") set(BUILD_OSM2PGSQL on CACHE BOOL "Build osm2pgsql (expert only)") #----------------------------------------------------------------------------- @@@ -127,27 -128,6 +128,27 @@@ if (BUILD_IMPORTER ${PROJECT_BINARY_DIR}/nominatim) endif() +#----------------------------------------------------------------------------- +# Targets for running a development webserver from the build directory. +#----------------------------------------------------------------------------- + +if (BUILD_API) + set(WEBSITEFILES + 403.html + 509.html + crossdomain.xml + favicon.ico + nominatim.xml + robots.txt + taginfo.json + ) + + foreach (webfile ${WEBSITEFILES}) + configure_file(${PROJECT_SOURCE_DIR}/website/${webfile} + ${PROJECT_BINARY_DIR}/website/${webfile}) + endforeach() +endif() + #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- @@@ -230,6 -210,14 +231,14 @@@ if (BUILD_DOCS endif() #----------------------------------------------------------------------------- + # Manual page + #----------------------------------------------------------------------------- + + if (BUILD_MANPAGE) + add_subdirectory(manual) + endif() + + #----------------------------------------------------------------------------- # Installation #----------------------------------------------------------------------------- diff --combined lib-php/website/search.php index 4dcbc5b7,ae3e1dbf..72ddebe1 --- a/lib-php/website/search.php +++ b/lib-php/website/search.php @@@ -54,12 -54,7 +54,12 @@@ if (!$oGeocode->getQueryString( $hLog = logStart($oDB, 'search', $oGeocode->getQueryString(), $aLangPrefOrder); -$aSearchResults = $oGeocode->lookup(); +// Ignore requests from a faulty app. +if ($oGeocode->getQueryString() === '-1,-1') { + $aSearchResults = array(); +} else { + $aSearchResults = $oGeocode->lookup(); +} logEnd($oDB, $hLog, count($aSearchResults)); @@@ -72,11 -67,11 +72,11 @@@ if (isset($_SERVER['HTTP_ACCEPT_LANGUAG } if (isset($_SERVER['REQUEST_SCHEME']) - && isset($_SERVER['SERVER_NAME']) + && isset($_SERVER['HTTP_HOST']) && isset($_SERVER['DOCUMENT_URI']) ) { $sMoreURL = $_SERVER['REQUEST_SCHEME'].'://' - .$_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_URI'].'/?' + .$_SERVER['HTTP_HOST'].$_SERVER['DOCUMENT_URI'].'/?' .http_build_query($aMoreParams); } else { $sMoreURL = '/search.php'.http_build_query($aMoreParams);