summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-31 04:10:30 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-31 04:10:30 +0000
commita94519077bae9c7a38c20cd8d46dc76805110ad1 (patch)
treedba8f8bb0fd37512bc7e6f60b59afdb9242a2e5c /includes
parent699afdd1be4b8034c36474c7191972604bf5f54e (diff)
downloadbrdo-a94519077bae9c7a38c20cd8d46dc76805110ad1.tar.gz
brdo-a94519077bae9c7a38c20cd8d46dc76805110ad1.tar.bz2
- Patch #829968 by andypost, AlexisWilke: drupal_lookup_path() documentation and return mismatch.
Diffstat (limited to 'includes')
-rw-r--r--includes/path.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/path.inc b/includes/path.inc
index e2c3c9095..ac78b0a74 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -131,6 +131,7 @@ function drupal_lookup_path($action, $path = '', $path_language = NULL) {
// isn't a path that has this alias
elseif ($action == 'source' && !isset($cache['no_source'][$path_language][$path])) {
// Look for the value $path within the cached $map
+ $source = FALSE;
if (!isset($cache['map'][$path_language]) || !($source = array_search($path, $cache['map'][$path_language]))) {
// Get the most fitting result falling back with alias without language
if ($source = db_query("SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language DESC, pid DESC", array(
@@ -139,7 +140,6 @@ function drupal_lookup_path($action, $path = '', $path_language = NULL) {
':language_none' => LANGUAGE_NONE))
->fetchField()) {
$cache['map'][$path_language][$source] = $path;
- return $source;
}
else {
// We can't record anything into $map because we do not have a valid
@@ -148,6 +148,7 @@ function drupal_lookup_path($action, $path = '', $path_language = NULL) {
$cache['no_source'][$path_language][$path] = TRUE;
}
}
+ return $source;
}
}