aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/bookmark/LinkUtils.php2
-rw-r--r--application/front/controller/admin/ManageShaareController.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/application/bookmark/LinkUtils.php b/application/bookmark/LinkUtils.php
index 68914fca..e7af4d55 100644
--- a/application/bookmark/LinkUtils.php
+++ b/application/bookmark/LinkUtils.php
@@ -26,7 +26,7 @@ function html_extract_title($html)
26 */ 26 */
27function header_extract_charset($header) 27function header_extract_charset($header)
28{ 28{
29 preg_match('/charset="?([^; ]+)/i', $header, $match); 29 preg_match('/charset=["\']?([^; "\']+)/i', $header, $match);
30 if (! empty($match[1])) { 30 if (! empty($match[1])) {
31 return strtolower(trim($match[1])); 31 return strtolower(trim($match[1]));
32 } 32 }
diff --git a/application/front/controller/admin/ManageShaareController.php b/application/front/controller/admin/ManageShaareController.php
index ca2da9b5..ffb0dae4 100644
--- a/application/front/controller/admin/ManageShaareController.php
+++ b/application/front/controller/admin/ManageShaareController.php
@@ -69,7 +69,7 @@ class ManageShaareController extends ShaarliAdminController
69 $retrieveDescription 69 $retrieveDescription
70 ) 70 )
71 ); 71 );
72 if (! empty($title) && strtolower($charset) !== 'utf-8') { 72 if (! empty($title) && strtolower($charset) !== 'utf-8' && mb_check_encoding($charset)) {
73 $title = mb_convert_encoding($title, 'utf-8', $charset); 73 $title = mb_convert_encoding($title, 'utf-8', $charset);
74 } 74 }
75 } 75 }