diff options
-rw-r--r-- | index.php | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1245,7 +1245,7 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | // lf_id should only be present if the link exists. | 1247 | // lf_id should only be present if the link exists. |
1248 | $id = !empty($_POST['lf_id']) ? intval(escape($_POST['lf_id'])) : $LINKSDB->getNextId(); | 1248 | $id = isset($_POST['lf_id']) ? intval(escape($_POST['lf_id'])) : $LINKSDB->getNextId(); |
1249 | // Linkdate is kept here to: | 1249 | // Linkdate is kept here to: |
1250 | // - use the same permalink for notes as they're displayed when creating them | 1250 | // - use the same permalink for notes as they're displayed when creating them |
1251 | // - let users hack creation date of their posts | 1251 | // - let users hack creation date of their posts |
@@ -1318,9 +1318,13 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
1318 | // -------- User clicked the "Cancel" button when editing a link. | 1318 | // -------- User clicked the "Cancel" button when editing a link. |
1319 | if (isset($_POST['cancel_edit'])) | 1319 | if (isset($_POST['cancel_edit'])) |
1320 | { | 1320 | { |
1321 | $id = isset($_POST['lf_id']) ? (int) escape($_POST['lf_id']) : false; | ||
1322 | if (! isset($LINKSDB[$id])) { | ||
1323 | header('Location: ?'); | ||
1324 | } | ||
1321 | // If we are called from the bookmarklet, we must close the popup: | 1325 | // If we are called from the bookmarklet, we must close the popup: |
1322 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } | 1326 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } |
1323 | $link = $LINKSDB[(int) escape($_POST['lf_id'])]; | 1327 | $link = $LINKSDB[$id]; |
1324 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); | 1328 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); |
1325 | // Scroll to the link which has been edited. | 1329 | // Scroll to the link which has been edited. |
1326 | $returnurl .= '#'. $link['shorturl']; | 1330 | $returnurl .= '#'. $link['shorturl']; |