diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -1,6 +1,6 @@ | |||
1 | <?php | 1 | <?php |
2 | /** | 2 | /** |
3 | * Shaarli v0.5.4 - Shaare your links... | 3 | * Shaarli v0.6.0 - Shaare your links... |
4 | * | 4 | * |
5 | * The personal, minimalist, super-fast, no-database Delicious clone. | 5 | * The personal, minimalist, super-fast, no-database Delicious clone. |
6 | * | 6 | * |
@@ -115,7 +115,7 @@ $GLOBALS['config']['PUBSUBHUB_URL'] = ''; | |||
115 | /* | 115 | /* |
116 | * PHP configuration | 116 | * PHP configuration |
117 | */ | 117 | */ |
118 | define('shaarli_version', '0.5.4'); | 118 | define('shaarli_version', '0.6.0'); |
119 | 119 | ||
120 | // http://server.com/x/shaarli --> /shaarli/ | 120 | // http://server.com/x/shaarli --> /shaarli/ |
121 | define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); | 121 | define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); |
@@ -679,8 +679,8 @@ class pageBuilder | |||
679 | $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); | 679 | $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); |
680 | } | 680 | } |
681 | $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); | 681 | $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); |
682 | if (!empty($GLOBALS['plugins']['errors'])) { | 682 | if (!empty($GLOBALS['plugin_errors'])) { |
683 | $this->tpl->assign('plugin_errors', $GLOBALS['plugins']['errors']); | 683 | $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
@@ -1204,6 +1204,14 @@ function renderPage() | |||
1204 | exit; | 1204 | exit; |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | // Display openseach plugin (XML) | ||
1208 | if ($targetPage == Router::$PAGE_OPENSEARCH) { | ||
1209 | header('Content-Type: application/xml; charset=utf-8'); | ||
1210 | $PAGE->assign('serverurl', index_url($_SERVER)); | ||
1211 | $PAGE->renderPage('opensearch'); | ||
1212 | exit; | ||
1213 | } | ||
1214 | |||
1207 | // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...) | 1215 | // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...) |
1208 | if (isset($_GET['addtag'])) | 1216 | if (isset($_GET['addtag'])) |
1209 | { | 1217 | { |
@@ -1611,11 +1619,11 @@ function renderPage() | |||
1611 | $link_is_new = true; | 1619 | $link_is_new = true; |
1612 | $linkdate = strval(date('Ymd_His')); | 1620 | $linkdate = strval(date('Ymd_His')); |
1613 | // Get title if it was provided in URL (by the bookmarklet). | 1621 | // Get title if it was provided in URL (by the bookmarklet). |
1614 | $title = (empty($_GET['title']) ? '' : $_GET['title'] ); | 1622 | $title = empty($_GET['title']) ? '' : escape($_GET['title']); |
1615 | // Get description if it was provided in URL (by the bookmarklet). [Bronco added that] | 1623 | // Get description if it was provided in URL (by the bookmarklet). [Bronco added that] |
1616 | $description = (empty($_GET['description']) ? '' : $_GET['description']); | 1624 | $description = empty($_GET['description']) ? '' : escape($_GET['description']); |
1617 | $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); | 1625 | $tags = empty($_GET['tags']) ? '' : escape($_GET['tags']); |
1618 | $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); | 1626 | $private = !empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0; |
1619 | // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) | 1627 | // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) |
1620 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { | 1628 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { |
1621 | // Short timeout to keep the application responsive | 1629 | // Short timeout to keep the application responsive |