]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 30 Mar 2021 07:33:01 +0000 (09:33 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 30 Mar 2021 07:33:01 +0000 (09:33 +0200)
1  2 
CMakeLists.txt
lib-php/website/search.php

diff --combined CMakeLists.txt
index 40140056a1d99e9355ae1e9656bf70ee1523e782,6ac81c4f74b4763682131e3b867529e8417caf5e..7c2d7bb38a3ffcc7d61b341376902e1342988e51
@@@ -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
  #-----------------------------------------------------------------------------
  
index 4dcbc5b7b84b062354da6e8fca59745103a3c059,ae3e1dbff2d9288556bcf9e3dd6be85cbae55552..72ddebe1e3d32b265775596dc1538d21dad0f612
@@@ -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);