Browse Source

move filter condition cleanup before info_only state check

tkas 1 year ago
parent
commit
66c9c1ec66
1 changed files with 4 additions and 3 deletions
  1. 4 3
      gp/index.php

+ 4 - 3
gp/index.php

@@ -79,13 +79,14 @@ if(isset($_GET['gpx']) || isset($_GET['get_gpx'])){ //{{{
     //error_log("fi: ".$filter);
   }
 
-  //for intormation tourism only filter active and all other incative
-  if($filter == '' && $filter_only) $filter = 'AND false';
-
+  //cleanup filter for first OR and add AND with previous condition
   if($filter != ''){
     $filter = "AND ( ".ltrim($filter, " OR")." )";
   }
 
+  //for intormation tourism only filter active and all other incative
+  if($filter == '' && $filter_only) $filter = 'AND false';
+
   $query = "SELECT nodeid, ST_AsText(geom) AS geom, name, class FROM hicheck.analyze_cache WHERE class != '' $filter";
   $res = pg_query($db, $query);
   while ($n = pg_fetch_object($res)) {