X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=41a42cf6736b95ba60a45e71e322ace7bb56c0a0;hb=ce7b0b6480aa854ee6893f5c889277b0e3b13efc;hp=dfc00fbd6c5d437ef8e074494e7443f7f0067673;hpb=11609d9fd8ba53f049e6c913d8e3affab6cfc9ce;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index dfc00fbd..41a42cf6 100644 --- a/index.php +++ b/index.php @@ -1516,7 +1516,7 @@ function renderPage() // -------- User want to post a new link: Display link edit form. if (isset($_GET['post'])) { - $url = cleanup_url(escape($_GET['post'])); + $url = cleanup_url($_GET['post']); $link_is_new = false; // Check if URL is not already in database (in this case, we will edit the existing link) @@ -1541,8 +1541,8 @@ function renderPage() // Extract title. $title = html_extract_title($content); // Re-encode title in utf-8 if necessary. - if (! empty($title) && $charset != 'utf-8') { - $title = mb_convert_encoding($title, $charset, 'utf-8'); + if (! empty($title) && strtolower($charset) != 'utf-8') { + $title = mb_convert_encoding($title, 'utf-8', $charset); } } } @@ -1551,6 +1551,8 @@ function renderPage() $url = '?' . smallHash($linkdate); $title = 'Note: '; } + $url = escape($url); + $title = escape($title); $link = array( 'linkdate' => $linkdate,