Skip to content
Snippets Groups Projects
Commit ba40a416 authored by Angie Byron's avatar Angie Byron
Browse files

#445152 by caktux and akahn: Default drupal_get_path_alias() to returning the current page's alias.

parent 0f08d97b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment