X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;ds=sidebyside;f=items.php;h=e2fe1dbbe272b222d6f12d5df6e03a75ffbd6044;hb=d9bd82ee3aafe693572f5313aec93a995b2102a2;hp=e7a97231572a689dc0d4185706e66d2a7aab7b33;hpb=41c341624c16607ac710aac446cc0ead3c53671b;p=syp.git
diff --git a/items.php b/items.php
index e7a9723..e2fe1db 100644
--- 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"])) &&
@@ -15,7 +11,8 @@ function headers_callback ($output) {
}
header ("Content-type: application/vnd.google-earth.kml+xml");
- header ("Cache-control: must-revalidate");
+ // no-cache is needed otherwise IE does not try to get new version.
+ header ("Cache-control: no-cache, must-revalidate");
header (sprintf ("ETag: %s", $etag));
return $output;
@@ -29,7 +26,7 @@ function main ($features) {
';
if (SITETITLE) {
- printf (' %s', SITETITLE);
+ printf (' %s', htmlspecialchars (SITETITLE));
}
foreach ($features as $feature) {
$id = $feature->id;
@@ -77,9 +74,15 @@ function main ($features) {
';
}
+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 ();
+ $features = $connection->listfeatures ($_GET ['from_user']);
} catch (Exception $e) {
exit ("server error");
}