aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-04-06 22:00:52 +0200
committerArthurHoaro <arthur@hoa.ro>2016-05-03 19:51:29 +0200
commitce7b0b6480aa854ee6893f5c889277b0e3b13efc (patch)
tree8d8beb4ea5568d9989a5ebf52e2adc542e17f74e /index.php
parent11609d9fd8ba53f049e6c913d8e3affab6cfc9ce (diff)
downloadShaarli-ce7b0b6480aa854ee6893f5c889277b0e3b13efc.tar.gz
Shaarli-ce7b0b6480aa854ee6893f5c889277b0e3b13efc.tar.zst
Shaarli-ce7b0b6480aa854ee6893f5c889277b0e3b13efc.zip
Fixes #531 - Title retrieving is failing with multiple use case
see https://github.com/shaarli/Shaarli/issues/531 for details
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 dfc00fbd..41a42cf6 100644
--- a/index.php
+++ b/index.php
@@ -1516,7 +1516,7 @@ function renderPage()
1516 1516
1517 // -------- User want to post a new link: Display link edit form. 1517 // -------- User want to post a new link: Display link edit form.
1518 if (isset($_GET['post'])) { 1518 if (isset($_GET['post'])) {
1519 $url = cleanup_url(escape($_GET['post'])); 1519 $url = cleanup_url($_GET['post']);
1520 1520
1521 $link_is_new = false; 1521 $link_is_new = false;
1522 // Check if URL is not already in database (in this case, we will edit the existing link) 1522 // Check if URL is not already in database (in this case, we will edit the existing link)
@@ -1541,8 +1541,8 @@ function renderPage()
1541 // Extract title. 1541 // Extract title.
1542 $title = html_extract_title($content); 1542 $title = html_extract_title($content);
1543 // Re-encode title in utf-8 if necessary. 1543 // Re-encode title in utf-8 if necessary.
1544 if (! empty($title) && $charset != 'utf-8') { 1544 if (! empty($title) && strtolower($charset) != 'utf-8') {
1545 $title = mb_convert_encoding($title, $charset, 'utf-8'); 1545 $title = mb_convert_encoding($title, 'utf-8', $charset);
1546 } 1546 }
1547 } 1547 }
1548 } 1548 }
@@ -1551,6 +1551,8 @@ function renderPage()
1551 $url = '?' . smallHash($linkdate); 1551 $url = '?' . smallHash($linkdate);
1552 $title = 'Note: '; 1552 $title = 'Note: ';
1553 } 1553 }
1554 $url = escape($url);
1555 $title = escape($title);
1554 1556
1555 $link = array( 1557 $link = array(
1556 'linkdate' => $linkdate, 1558 'linkdate' => $linkdate,