From ce6dde980a6eb4a606f7e2d5b97c9445235b2b7a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 4 Dec 2006 10:48:28 +0000 Subject: - Patch #100957 by Tobias and chx: fixed return value of drupal_lookup_path(). --- includes/path.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/path.inc b/includes/path.inc index 75a869d48..0a791cc01 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -55,10 +55,12 @@ function drupal_lookup_path($action, $path = '') { } elseif ($count > 0 && $path != '') { if ($action == 'alias') { - if (isset($map[$path]) || array_key_exists($path, $map)) { + if (isset($map[$path])) { return $map[$path]; } - $alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path)); + if (!$alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path))) { + $alias = FALSE; + } $map[$path] = $alias; return $alias; } -- cgit v1.2.3