summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-17 13:48:53 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-17 13:48:53 +0000
commit453fab02bf7df0fde79a7e1e8b20bb18eb2b7897 (patch)
tree85d9c3396987d90a86e123d86d29994cdae2ec41 /includes
parentcb043e8c489f033f7435e7fd5d18325155465c77 (diff)
downloadbrdo-453fab02bf7df0fde79a7e1e8b20bb18eb2b7897.tar.gz
brdo-453fab02bf7df0fde79a7e1e8b20bb18eb2b7897.tar.bz2
- Patch #829968 by AlexisWilke: drupal_lookup_path() documentation and return mismatch.
Diffstat (limited to 'includes')
-rw-r--r--includes/path.inc3
1 files changed, 1 insertions, 2 deletions
diff --git a/includes/path.inc b/includes/path.inc
index daaca1163..9315ccf62 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -127,7 +127,6 @@ 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 = '';
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(
@@ -136,6 +135,7 @@ 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
@@ -144,7 +144,6 @@ function drupal_lookup_path($action, $path = '', $path_language = NULL) {
$cache['no_source'][$path_language][$path] = TRUE;
}
}
- return $source;
}
}