aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/index.php b/index.php
index e5bfc2c2..58bb3f44 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,6 @@
1<?php 1<?php
2/** 2/**
3 * Shaarli v0.8.3 - Shaare your links... 3 * Shaarli - The personal, minimalist, super-fast, database free, bookmarking service.
4 *
5 * The personal, minimalist, super-fast, database free, bookmarking service.
6 * 4 *
7 * Friendly fork by the Shaarli community: 5 * Friendly fork by the Shaarli community:
8 * - https://github.com/shaarli/Shaarli 6 * - https://github.com/shaarli/Shaarli
@@ -25,7 +23,6 @@ if (date_default_timezone_get() == '') {
25/* 23/*
26 * PHP configuration 24 * PHP configuration
27 */ 25 */
28define('shaarli_version', '0.8.2');
29 26
30// http://server.com/x/shaarli --> /shaarli/ 27// http://server.com/x/shaarli --> /shaarli/
31define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0))); 28define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0)));
@@ -90,6 +87,8 @@ try {
90 exit; 87 exit;
91} 88}
92 89
90define('shaarli_version', ApplicationUtils::getVersion(__DIR__ .'/'. ApplicationUtils::$VERSION_FILE));
91
93// Force cookie path (but do not change lifetime) 92// Force cookie path (but do not change lifetime)
94$cookie = session_get_cookie_params(); 93$cookie = session_get_cookie_params();
95$cookiedir = ''; 94$cookiedir = '';
@@ -1246,7 +1245,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1246 } 1245 }
1247 1246
1248 // lf_id should only be present if the link exists. 1247 // lf_id should only be present if the link exists.
1249 $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();
1250 // Linkdate is kept here to: 1249 // Linkdate is kept here to:
1251 // - 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
1252 // - let users hack creation date of their posts 1251 // - let users hack creation date of their posts
@@ -1319,9 +1318,13 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1319 // -------- User clicked the "Cancel" button when editing a link. 1318 // -------- User clicked the "Cancel" button when editing a link.
1320 if (isset($_POST['cancel_edit'])) 1319 if (isset($_POST['cancel_edit']))
1321 { 1320 {
1321 $id = isset($_POST['lf_id']) ? (int) escape($_POST['lf_id']) : false;
1322 if (! isset($LINKSDB[$id])) {
1323 header('Location: ?');
1324 }
1322 // 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:
1323 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; }
1324 $link = $LINKSDB[(int) escape($_POST['lf_id'])]; 1327 $link = $LINKSDB[$id];
1325 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); 1328 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
1326 // Scroll to the link which has been edited. 1329 // Scroll to the link which has been edited.
1327 $returnurl .= '#'. $link['shorturl']; 1330 $returnurl .= '#'. $link['shorturl'];