diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-30 11:35:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 11:35:57 +0200 |
commit | c3fca560b624588d37508142ab73573caf467573 (patch) | |
tree | c02c33b6db135b5e23c36bd4950b656dd3e125c2 /application/bookmark/LinkUtils.php | |
parent | 769a28833b68f4c629c5578348b31d51016fbf6f (diff) | |
parent | 1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a (diff) | |
download | Shaarli-c3fca560b624588d37508142ab73573caf467573.tar.gz Shaarli-c3fca560b624588d37508142ab73573caf467573.tar.zst Shaarli-c3fca560b624588d37508142ab73573caf467573.zip |
Merge pull request #1569 from ArthurHoaro/fix/bad-encoding
Fix warning if the encoding retrieved from external headers is invalid
Diffstat (limited to 'application/bookmark/LinkUtils.php')
-rw-r--r-- | application/bookmark/LinkUtils.php | 2 |
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 | */ |
27 | function header_extract_charset($header) | 27 | function 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 | } |