]> dev.renevier.net Git - syp.git/blobdiff - items.php
improve wizard (hand editing of settings.php is no more needed)
[syp.git] / items.php
index cd2cd91bb14c6aff37a52a2f250ce4e2231b4c26..a2a04464e398110e1cd1e2bc71f66b3d87a9e3c8 100644 (file)
--- a/items.php
+++ b/items.php
@@ -2,10 +2,6 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
-require_once ("./inc/settings.php");
-require_once ("./inc/utils.php");
-require_once ("./inc/db/mysql.php");
-
 function headers_callback ($output) {
     $etag = md5 ($output);
     if ((isset ($_SERVER ["HTTP_IF_NONE_MATCH"])) && 
@@ -29,7 +25,7 @@ function main ($features) {
 ';
 
     if (SITETITLE) {
-        printf ('    <name>%s</name>', SITETITLE);
+        printf ('    <name>%s</name>', htmlspecialchars (SITETITLE));
     }
     foreach ($features as $feature) {
         $id = $feature->id;
@@ -77,6 +73,12 @@ function main ($features) {
     </kml>';
 }
 
+if (!@include_once ("./inc/settings.php")) {
+    exit ("server error");
+}
+require_once ("./inc/utils.php");
+require_once ("./inc/db/mysql.php");
+
 try {
     $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
     $features = $connection->listfeatures ($_GET ['from_user']);