From ba40a41659d8cb9d38fcbaf79d48b97b61f64416 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 7 May 2009 15:49:57 +0000 Subject: #445152 by caktux and akahn: Default drupal_get_path_alias() to returning the current page's alias. --- includes/path.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'includes') 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; -- cgit v1.2.3