function callback($params) { global $db_charset; $platformApiClient = $this->_getPlatformApiClient(); $got = PlatformApiClientUtility::decodeJson($platformApiClient->post('weibo.login.sitecallback', $params)); return isset($got->result) ? $got->result : (isset($got->message) ? PlatformApiClientUtility::convertCharset('UTF-8', $db_charset, $got->message) : false); }
function convertCharset($inCharset, $outCharset, $data) { if (is_array($data)) { $newData = array(); foreach ($data as $key => $value) { $newKey = PlatformApiClientUtility::convertCharset($inCharset, $outCharset, $key); $newValue = PlatformApiClientUtility::convertCharset($inCharset, $outCharset, $value); $newData[$newKey] = $newValue; } return $newData; } return pwConvert($data, $outCharset, $inCharset); }