aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-05-03 19:53:57 +0200
committerArthur <arthur@hoa.ro>2016-05-03 19:53:57 +0200
commit47be06098396b5eef35234b88227d64ab81bd988 (patch)
treebb42c742179e75c7f15c4126ddf79838ceb94331 /index.php
parent5a63c34f3a68ce2f53ee9164e2a35a0904676399 (diff)
parentce7b0b6480aa854ee6893f5c889277b0e3b13efc (diff)
downloadShaarli-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.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/index.php b/index.php
index 456d93c2..e9b0bf40 100644
--- a/index.php
+++ b/index.php
@@ -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,