aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-26 13:28:38 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-30 11:11:19 +0200
commit1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a (patch)
treeaa002767f8d59c11c71fab3d1b27d22978cb85ec /application/bookmark
parentd0ae1ba273b6decea8d35ef79bfabb055b0fb6df (diff)
downloadShaarli-1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a.tar.gz
Shaarli-1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a.tar.zst
Shaarli-1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a.zip
Fix warning if the encoding retrieved from external headers is invalid
Also fixed the regex to support this failing header: charset="utf-8"\r\n"
Diffstat (limited to 'application/bookmark')
-rw-r--r--application/bookmark/LinkUtils.php2
1 files changed, 1 insertions, 1 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 }