diff options
author | Arthur <arthur@hoa.ro> | 2016-05-03 19:53:57 +0200 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2016-05-03 19:53:57 +0200 |
commit | 47be06098396b5eef35234b88227d64ab81bd988 (patch) | |
tree | bb42c742179e75c7f15c4126ddf79838ceb94331 /index.php | |
parent | 5a63c34f3a68ce2f53ee9164e2a35a0904676399 (diff) | |
parent | ce7b0b6480aa854ee6893f5c889277b0e3b13efc (diff) | |
download | Shaarli-47be06098396b5eef35234b88227d64ab81bd988.tar.gz Shaarli-47be06098396b5eef35234b88227d64ab81bd988.tar.zst Shaarli-47be06098396b5eef35234b88227d64ab81bd988.zip |
Merge pull request #532 from ArthurHoaro/hotfix/title-retrieve-the-return
Fixes #531 - Title retrieving is failing with multiple use case
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1519,7 +1519,7 @@ function renderPage() | |||
1519 | 1519 | ||
1520 | // -------- User want to post a new link: Display link edit form. | 1520 | // -------- User want to post a new link: Display link edit form. |
1521 | if (isset($_GET['post'])) { | 1521 | if (isset($_GET['post'])) { |
1522 | $url = cleanup_url(escape($_GET['post'])); | 1522 | $url = cleanup_url($_GET['post']); |
1523 | 1523 | ||
1524 | $link_is_new = false; | 1524 | $link_is_new = false; |
1525 | // Check if URL is not already in database (in this case, we will edit the existing link) | 1525 | // Check if URL is not already in database (in this case, we will edit the existing link) |
@@ -1544,8 +1544,8 @@ function renderPage() | |||
1544 | // Extract title. | 1544 | // Extract title. |
1545 | $title = html_extract_title($content); | 1545 | $title = html_extract_title($content); |
1546 | // Re-encode title in utf-8 if necessary. | 1546 | // Re-encode title in utf-8 if necessary. |
1547 | if (! empty($title) && $charset != 'utf-8') { | 1547 | if (! empty($title) && strtolower($charset) != 'utf-8') { |
1548 | $title = mb_convert_encoding($title, $charset, 'utf-8'); | 1548 | $title = mb_convert_encoding($title, 'utf-8', $charset); |
1549 | } | 1549 | } |
1550 | } | 1550 | } |
1551 | } | 1551 | } |
@@ -1554,6 +1554,8 @@ function renderPage() | |||
1554 | $url = '?' . smallHash($linkdate); | 1554 | $url = '?' . smallHash($linkdate); |
1555 | $title = 'Note: '; | 1555 | $title = 'Note: '; |
1556 | } | 1556 | } |
1557 | $url = escape($url); | ||
1558 | $title = escape($title); | ||
1557 | 1559 | ||
1558 | $link = array( | 1560 | $link = array( |
1559 | 'linkdate' => $linkdate, | 1561 | 'linkdate' => $linkdate, |