Commit d2175fdc authored by Dries's avatar Dries

- Fixed cache issue with path map.
parent f2a9d01d
...@@ -29,17 +29,25 @@ function conf_init() { ...@@ -29,17 +29,25 @@ function conf_init() {
* Build the alias/path array * Build the alias/path array
*/ */
function drupal_get_path_map($action = "") { function drupal_get_path_map($action = "") {
static $cache;
static $map; static $map;
if ($action == "rebuild") { if ($action == "rebuild") {
$map = NULL; $map = NULL;
$cache = 0;
} }
if (empty($map)) { if (!$cache) {
$result = db_query("SELECT * FROM {path}"); if (!$result) {
$result = db_query("SELECT * FROM {path}");
}
while ($data = db_fetch_object($result)) { while ($data = db_fetch_object($result)) {
$map[$data->dst] = $data->src; $map[$data->dst] = $data->src;
} }
$cache = 1;
} }
return $map; return $map;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment