]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/bookmark/LinkUtils.php
Fix warning if the encoding retrieved from external headers is invalid
[github/shaarli/Shaarli.git] / application / bookmark / LinkUtils.php
index 68914fcab749a19b1ba15193decd99247158375a..e7af4d552b409b77595985cc635273a6a1d8e448 100644 (file)
@@ -26,7 +26,7 @@ function html_extract_title($html)
  */
 function header_extract_charset($header)
 {
-    preg_match('/charset="?([^; ]+)/i', $header, $match);
+    preg_match('/charset=["\']?([^; "\']+)/i', $header, $match);
     if (! empty($match[1])) {
         return strtolower(trim($match[1]));
     }