X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=8eda9880f9c995f86b62b2e786e3d73ba321fb78;hb=refs%2Fpull%2F277%2Fhead;hp=b06dd50ce0a1e957cc530affeaf5ac041287f6c3;hpb=44d60adc5e2fa547bc49620f7e647794f0cad631;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index b06dd50c..8eda9880 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ /shaarli/ define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); @@ -679,8 +679,8 @@ class pageBuilder $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); } $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); - if (!empty($GLOBALS['plugins']['errors'])) { - $this->tpl->assign('plugin_errors', $GLOBALS['plugins']['errors']); + if (!empty($GLOBALS['plugin_errors'])) { + $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); } } @@ -1204,6 +1204,14 @@ function renderPage() exit; } + // Display openseach plugin (XML) + if ($targetPage == Router::$PAGE_OPENSEARCH) { + header('Content-Type: application/xml; charset=utf-8'); + $PAGE->assign('serverurl', index_url($_SERVER)); + $PAGE->renderPage('opensearch'); + exit; + } + // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...) if (isset($_GET['addtag'])) { @@ -1611,11 +1619,11 @@ function renderPage() $link_is_new = true; $linkdate = strval(date('Ymd_His')); // Get title if it was provided in URL (by the bookmarklet). - $title = (empty($_GET['title']) ? '' : $_GET['title'] ); + $title = empty($_GET['title']) ? '' : escape($_GET['title']); // Get description if it was provided in URL (by the bookmarklet). [Bronco added that] - $description = (empty($_GET['description']) ? '' : $_GET['description']); - $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); - $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); + $description = empty($_GET['description']) ? '' : escape($_GET['description']); + $tags = empty($_GET['tags']) ? '' : escape($_GET['tags']); + $private = !empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0; // 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.) if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { // Short timeout to keep the application responsive