summaryrefslogtreecommitdiff
path: root/bookmarkcommondescriptionedit.php
diff options
context:
space:
mode:
Diffstat (limited to 'bookmarkcommondescriptionedit.php')
-rw-r--r--bookmarkcommondescriptionedit.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/bookmarkcommondescriptionedit.php b/bookmarkcommondescriptionedit.php
index 1ac316e..ec7aee2 100644
--- a/bookmarkcommondescriptionedit.php
+++ b/bookmarkcommondescriptionedit.php
@@ -33,8 +33,15 @@ isset($_POST['cancel']) ? define('POST_CANCEL', $_POST['cancel']): define('POST_
isset($_POST['hash']) ? define('POST_HASH', $_POST['hash']): define('POST_HASH', '');
isset($_POST['title']) ? define('POST_TITLE', $_POST['title']): define('POST_TITLE', '');
isset($_POST['description']) ? define('POST_DESCRIPTION', $_POST['description']): define('POST_DESCRIPTION', '');
-isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', '');
+// prevent cycle between personal and common edit page
+if(!isset($_POST['referrer'])) {
+ define('POST_REFERRER', '');
+} elseif(strpos($_POST['referrer'], ROOT.'edit.php') == 0) {
+ define('POST_REFERRER', createUrl('history', POST_HASH));
+} else {
+ define('POST_REFERRER', $_POST['referrer']);
+}
list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']);