summaryrefslogtreecommitdiffstats
path: root/lib/ui.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r--lib/ui.lib.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index d0d58ac7..5f74d525 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -105,11 +105,14 @@ function access_denied() {
function return_referer() {
$referer = $_SERVER['HTTP_REFERER'];
-
- $file = basename($referer);
-
- /* Strip off the filename */
- $referer = substr($referer,0,strlen($referer)-strlen($file));
+ if (substr($referer, -1)=='/'){
+ $file = 'index.php';
+ }
+ else {
+ $file = basename($referer);
+ /* Strip off the filename */
+ $referer = substr($referer,0,strlen($referer)-strlen($file));
+ }
if (substr($referer,strlen($referer)-6,6) == 'admin/') {
$file = 'admin/' . $file;