Fix URL conflict when the same spool is used on different site.
[banana.git] / banana / tree.inc.php
index 667925f..09fe261 100644 (file)
@@ -151,7 +151,11 @@ class BananaTree
      */
     static private function filename($id)
     {
-        return BananaSpool::getPath('tree_' . $id);
+        static $host;
+        if (!isset($host)) {
+            $host = parse_url(Banana::$page->makeURL(array()), PHP_URL_HOST);
+        }
+        return BananaSpool::getPath('tree_' . $id . '_' . $host);
     }
 
     /** Read a tree from a file