Try fix encode UTF-8 url

This commit is contained in:
Knah Tsaeb 2018-10-03 09:12:47 +02:00
parent 9d3a3062e8
commit 812b96302a

View file

@ -146,7 +146,7 @@ function tryWithCurl($hash, $log)
$line = trim($line);
$line = explode(' --- ', $line);
//$hash = sha1($GLOBALS['config']['salt'].rawurldecode($line[1]));
$line[1] = iconv($charset, "UTF-8", $line[1]);
$line[1] = iconv(mb_detect_encoding($line[1], mb_detect_order(), true), "UTF-8", $line[1]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $line[1]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@ -190,7 +190,7 @@ function tryWithOpenGraph($hash, $log)
$line = explode(' --- ', $line);
$url = $line[1];
$startPath = '';
$url = iconv($charset, "UTF-8", $url);
$url = iconv(mb_detect_encoding($line[1], mb_detect_order(), true), "UTF-8", $url);
$info = Embed::create($url);
$ext = testIfImg($info->image);