diff --git a/inc/admin.php b/inc/admin.php index 67dec0c..34a261b 100644 --- a/inc/admin.php +++ b/inc/admin.php @@ -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);