X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FParseUrl.php;h=f1e96dedc3b8347a0c673f5134c285b0c2f2203e;hb=7e6ba0b4d271735bbf7474fb75a7cf43b787b678;hp=0183d6b14ae5be6785f90eaf5c16af01e6974de9;hpb=09cb4c154084443b06c958557126e633b7943480;p=friendica.git
diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php
index 0183d6b14a..f1e96dedc3 100644
--- a/src/Util/ParseUrl.php
+++ b/src/Util/ParseUrl.php
@@ -1,6 +1,6 @@
* @endverbatim
*/
- public static function getSiteinfo(string $url, bool $do_oembed = true, int $count = 1)
+ public static function getSiteinfo(string $url, bool $do_oembed = true, int $count = 1): array
{
if (empty($url)) {
return [
@@ -214,7 +216,7 @@ class ParseUrl
];
if ($count > 10) {
- Logger::notice('Endless loop detected', ['url' => $url]);
+ Logger::warning('Endless loop detected', ['url' => $url]);
return $siteinfo;
}
@@ -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)), ';,'));
- }
-
- // Then in body that gets precedence
- // Expected forms:
- // -
- // -
- // -
- // -
- // We escape