summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-07 15:49:57 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-07 15:49:57 +0000
commitba40a41659d8cb9d38fcbaf79d48b97b61f64416 (patch)
tree362c17a2c401f8e32c42a642140b38661d49c897 /includes
parent0f08d97b2151b8baab95f92d46808d250191b2f1 (diff)
downloadbrdo-ba40a41659d8cb9d38fcbaf79d48b97b61f64416.tar.gz
brdo-ba40a41659d8cb9d38fcbaf79d48b97b61f64416.tar.bz2
#445152 by caktux and akahn: Default drupal_get_path_alias() to returning the current page's alias.
Diffstat (limited to 'includes')
-rw-r--r--includes/path.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/path.inc b/includes/path.inc
index b2a4b0ffa..a4659d7c0 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -105,6 +105,9 @@ function drupal_lookup_path($action, $path = '', $path_language = '') {
/**
* Given an internal Drupal path, return the alias set by the administrator.
*
+ * If no path is provided, the function will return the alias of the current
+ * page.
+ *
* @param $path
* An internal Drupal path.
* @param $path_language
@@ -114,7 +117,11 @@ function drupal_lookup_path($action, $path = '', $path_language = '') {
* An aliased path if one was found, or the original path if no alias was
* found.
*/
-function drupal_get_path_alias($path, $path_language = '') {
+function drupal_get_path_alias($path = NULL, $path_language = '') {
+ // If no path is specified, use the current page's path.
+ if ($path == NULL) {
+ $path = $_GET['q'];
+ }
$result = $path;
if ($alias = drupal_lookup_path('alias', $path, $path_language)) {
$result = $alias;