Commit d2175fdc authored by Dries's avatar Dries

- Fixed cache issue with path map.

parent f2a9d01d
......@@ -29,17 +29,25 @@ function conf_init() {
* Build the alias/path array
*/
function drupal_get_path_map($action = "") {
static $cache;
static $map;
if ($action == "rebuild") {
$map = NULL;
$cache = 0;
}
if (empty($map)) {
$result = db_query("SELECT * FROM {path}");
if (!$cache) {
if (!$result) {
$result = db_query("SELECT * FROM {path}");
}
while ($data = db_fetch_object($result)) {
$map[$data->dst] = $data->src;
}
$cache = 1;
}
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