diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-12-23 22:04:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-12-23 22:04:52 +0000 |
commit | 5c3086ee4a4d6da13d1ec450aaf5728bc6b64de5 (patch) | |
tree | 9f6d49ca921a24ba1a0c4b2ff831c9ebee245eb6 /includes | |
parent | 0d57baef27b07c22653310ec4ebb610e084bb671 (diff) | |
download | brdo-5c3086ee4a4d6da13d1ec450aaf5728bc6b64de5.tar.gz brdo-5c3086ee4a4d6da13d1ec450aaf5728bc6b64de5.tar.bz2 |
- Patch #100957 by chx: clean up drupal_lookup_path()
Diffstat (limited to 'includes')
-rw-r--r-- | includes/path.inc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/includes/path.inc b/includes/path.inc index 0a791cc01..b911dae60 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -42,10 +42,10 @@ function drupal_init_path() { function drupal_lookup_path($action, $path = '') { // $map keys are Drupal paths and the values are the corresponding aliases static $map = array(), $no_src = array(); - static $count = NULL; + static $count; // Use $count to avoid looking up paths in subsequent calls if there simply are no aliases - if ($count === NULL) { + if (!isset($count)) { $count = db_result(db_query('SELECT COUNT(pid) FROM {url_alias}')); } @@ -58,9 +58,7 @@ function drupal_lookup_path($action, $path = '') { if (isset($map[$path])) { return $map[$path]; } - if (!$alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path))) { - $alias = FALSE; - } + $alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path)); $map[$path] = $alias; return $alias; } |