Fix invalid query.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 16 Dec 2008 14:50:04 +0000 (15:50 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 16 Dec 2008 14:50:04 +0000 (15:50 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/geoloc.inc.php

index 8511a4e..28ffe51 100644 (file)
@@ -326,8 +326,10 @@ function fix_cities_not_on_map($limit=false, $cityid=false)
                 $values .= ",($cityid, $map_id, '')";
             }
         }
-        XDB::execute("REPLACE INTO  geoloc_city_in_maps
-                            VALUES  ".substr($values, 1));
+        if (strlen($values) > 1) {
+            XDB::execute("REPLACE INTO  geoloc_city_in_maps
+                                VALUES  ".substr($values, 1));
+        }
     } else {
         return false;
     }