diff options
-rw-r--r-- | index.php | 36 | ||||
-rw-r--r-- | tpl/default/css/shaarli.css | 2 | ||||
-rw-r--r-- | tpl/default/editlink.html | 2 |
3 files changed, 12 insertions, 28 deletions
@@ -1208,7 +1208,7 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
1208 | $LINKSDB[$key]=$value; | 1208 | $LINKSDB[$key]=$value; |
1209 | } | 1209 | } |
1210 | $LINKSDB->save($conf->get('resource.page_cache')); | 1210 | $LINKSDB->save($conf->get('resource.page_cache')); |
1211 | echo '<script>alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>'; | 1211 | echo '<script>alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?do=changetag\';</script>'; |
1212 | exit; | 1212 | exit; |
1213 | } | 1213 | } |
1214 | 1214 | ||
@@ -1349,31 +1349,15 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
1349 | 1349 | ||
1350 | // If we are called from the bookmarklet, we must close the popup: | 1350 | // If we are called from the bookmarklet, we must close the popup: |
1351 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } | 1351 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } |
1352 | // Pick where we're going to redirect | 1352 | |
1353 | // ============================================================= | 1353 | $location = '?'; |
1354 | // Basically, we can't redirect to where we were previously if it was a permalink | 1354 | if (isset($_SERVER['HTTP_REFERER'])) { |
1355 | // or an edit_link, because it would 404. | 1355 | // Don't redirect to where we were previously if it was a permalink or an edit_link, because it would 404. |
1356 | // Cases: | 1356 | $location = generateLocation( |
1357 | // - / : nothing in $_GET, redirect to self | 1357 | $_SERVER['HTTP_REFERER'], |
1358 | // - /?page : redirect to self | 1358 | $_SERVER['HTTP_HOST'], |
1359 | // - /?searchterm : redirect to self (there might be other links) | 1359 | ['delete_link', 'edit_link', $link['shorturl']] |
1360 | // - /?searchtags : redirect to self | 1360 | ); |
1361 | // - /permalink : redirect to / (the link does not exist anymore) | ||
1362 | // - /?edit_link : redirect to / (the link does not exist anymore) | ||
1363 | // PHP treats the permalink as a $_GET variable, so we need to check if every condition for self | ||
1364 | // redirect is not satisfied, and only then redirect to / | ||
1365 | $location = "?"; | ||
1366 | // Self redirection | ||
1367 | if (count($_GET) == 0 | ||
1368 | || isset($_GET['page']) | ||
1369 | || isset($_GET['searchterm']) | ||
1370 | || isset($_GET['searchtags']) | ||
1371 | ) { | ||
1372 | if (isset($_POST['returnurl'])) { | ||
1373 | $location = $_POST['returnurl']; // Handle redirects given by the form | ||
1374 | } else if (isset($_SERVER['HTTP_REFERER'])) { | ||
1375 | $location = generateLocation($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'], array('delete_link')); | ||
1376 | } | ||
1377 | } | 1361 | } |
1378 | 1362 | ||
1379 | header('Location: ' . $location); // After deleting the link, redirect to appropriate location | 1363 | header('Location: ' . $location); // After deleting the link, redirect to appropriate location |
diff --git a/tpl/default/css/shaarli.css b/tpl/default/css/shaarli.css index 6d73af3e..7ca567e7 100644 --- a/tpl/default/css/shaarli.css +++ b/tpl/default/css/shaarli.css | |||
@@ -55,7 +55,7 @@ strong { | |||
55 | cursor: pointer; | 55 | cursor: pointer; |
56 | height: 24px; | 56 | height: 24px; |
57 | padding: 0 5px; | 57 | padding: 0 5px; |
58 | margin: 5px 5px 0 0; | 58 | margin: 0 5px 0 0; |
59 | color: #606060; | 59 | color: #606060; |
60 | border-style: outset; | 60 | border-style: outset; |
61 | border-width: 1px; | 61 | border-width: 1px; |
diff --git a/tpl/default/editlink.html b/tpl/default/editlink.html index a2d9b78f..f855dfb1 100644 --- a/tpl/default/editlink.html +++ b/tpl/default/editlink.html | |||
@@ -35,7 +35,7 @@ | |||
35 | <label for="lf_private"><i>Private</i></label><br> | 35 | <label for="lf_private"><i>Private</i></label><br> |
36 | {else} | 36 | {else} |
37 | <input type="checkbox" name="lf_private" id="lf_private"> | 37 | <input type="checkbox" name="lf_private" id="lf_private"> |
38 | <label for="lf_private"><i>Private</i></label><br> | 38 | <label for="lf_private"><i>Private</i></label><br><br> |
39 | {/if} | 39 | {/if} |
40 | <input type="submit" value="Save" name="save_edit" class="bigbutton"> | 40 | <input type="submit" value="Save" name="save_edit" class="bigbutton"> |
41 | <input type="submit" value="Cancel" name="cancel_edit" class="bigbutton"> | 41 | <input type="submit" value="Cancel" name="cancel_edit" class="bigbutton"> |