From 5c3086ee4a4d6da13d1ec450aaf5728bc6b64de5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 23 Dec 2006 22:04:52 +0000 Subject: [PATCH] - Patch #100957 by chx: clean up drupal_lookup_path() --- includes/path.inc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/path.inc b/includes/path.inc index 0a791cc0196..b911dae60f9 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; }