aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 9005cf010..7e785ce07 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -38,6 +38,30 @@
return false;
}
+
+ /**
+ * Return the current page URL.
+ */
+ function current_page_url()
+ {
+ global $CONFIG;
+
+ $url = parse_url($CONFIG->wwwroot);
+
+ $page = $url['scheme'] . "://";
+
+ // user/pass
+ if ($url['user']) $page .= $url['user'];
+ if ($url['pass']) $page .= ":".$url['pass'];
+ if (($url['user']) || $url['pass']) $page .="@";
+
+ $page .= $url['host'];
+ $page = trim($page, "/"); $page.="/";
+
+ $page .= $_SERVER['REQUEST_URI'];
+
+ return $page;
+ }
/**
* Templating