This commit is contained in:
Daniil Gentili 2017-01-29 14:38:22 +00:00
parent 7d388f9cbe
commit b33ec1da0e
2 changed files with 13 additions and 1 deletions

View File

@ -478,7 +478,7 @@ trait UpdateHandler
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $this->hook_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($update));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($this->utf8ize($update)));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$parse = parse_url($this->hook_url);
if (isset($parse['scheme']) && $parse['scheme'] == 'https') {

View File

@ -48,4 +48,16 @@ trait Tools
return $handle;
}
public function utf8ize($d)
{
if (is_array($d)) {
foreach ($d as $k => $v) {
$d[$k] = $this->utf8ize($v);
}
} elseif (is_string($d)) {
return utf8_encode($d);
}
return $d;
}
}