--- bootstrap.inc 5 Apr 2005 19:00:24 -0000 1.44 +++ bootstrap.inc 5 May 2005 01:45:33 -0000 @@ -349,32 +349,12 @@ } /** - * Return an array mapping path aliases to their internal Drupal paths. - */ -function drupal_get_path_map($action = '') { - static $map = NULL; - - if ($action == 'rebuild') { - $map = NULL; - } - - if (is_null($map)) { - $map = array(); // Make $map non-null in case no aliases are defined. - $result = db_query('SELECT * FROM {url_alias}'); - while ($data = db_fetch_object($result)) { - $map[$data->dst] = $data->src; - } - } - - return $map; -} - -/** * Given an internal Drupal path, return the alias set by the administrator. */ function drupal_get_path_alias($path) { - if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) { - return $newpath; + $result = db_query("SELECT dst FROM {url_alias} WHERE src='%s'", $path); + if ($data = db_fetch_object($result)) { + return $data->dst; } elseif (function_exists('conf_url_rewrite')) { return conf_url_rewrite($path, 'outgoing');