X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FParseUrl.php;h=f1e96dedc3b8347a0c673f5134c285b0c2f2203e;hb=7e6ba0b4d271735bbf7474fb75a7cf43b787b678;hp=f21528353d3fee175d1259b0c3b86ca501777031;hpb=6aa1dcfad371f34fea1f8e39b73de2cc3dd05784;p=friendica.git diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index f21528353d..f1e96dedc3 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -24,6 +24,8 @@ namespace Friendica\Util; use DOMDocument; use DOMXPath; use Friendica\Content\OEmbed; +use Friendica\Content\Text\HTML; +use Friendica\Protocol\HTTP\MediaType; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Database\Database; @@ -283,25 +285,13 @@ class ParseUrl } $charset = ''; - // Look for a charset, first in headers - // Expected form: Content-Type: text/html; charset=ISO-8859-4 - if (preg_match('/charset=([a-z0-9-_.\/]+)/i', $curlResult->getContentType(), $matches)) { - $charset = trim(trim(trim(array_pop($matches)), ';,')); - } else { - // Then in body that gets precedence - // Expected forms: - // - - // - - // - - // - - // We escape