]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Redirect to homepage after adding a link via "Add Link" dialog
authornodiscc <nodiscc@gmail.com>
Wed, 4 Mar 2015 18:09:01 +0000 (19:09 +0100)
committernodiscc <nodiscc@gmail.com>
Thu, 5 Mar 2015 12:43:53 +0000 (13:43 +0100)
 * Fixes https://github.com/shaarli/Shaarli/issues/115

index.php

index a8326a2b4422baad7ee32ac3b266e3eb3328614c..cda918df82c45a7dd56d90280eb7e8bc6a2e53d3 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1560,6 +1560,7 @@ function renderPage()
         if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; }
         $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
         $returnurl .= '#'.smallHash($linkdate);  // Scroll to the link which has been edited.
+        if (strstr($returnurl, "do=addlink")) { $returnurl = '?'; } //if we come from ?do=addlink, set returnurl to homepage instead
         header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on.
         exit;
     }