use wcf\data\object\type\ObjectTypeCache;
use wcf\system\io\HttpFactory;
use wcf\system\payment\type\IPaymentType;
-use wcf\util\StringUtil;
/**
* Handles Paypal callbacks.
// fix encoding
if (!empty($_POST['charset']) && \strtoupper($_POST['charset']) != 'UTF-8') {
foreach ($_POST as &$value) {
- $value = StringUtil::convertEncoding(\strtoupper($_POST['charset']), 'UTF-8', $value);
+ $value = \mb_convert_encoding($value, 'UTF-8', \strtoupper($_POST['charset']));
}
}
$requestURI = (!empty($_SERVER['UNENCODED_URL'])) ? $_SERVER['UNENCODED_URL'] : $_SERVER['REQUEST_URI'];
if (!StringUtil::isUTF8($requestURI)) {
- $requestURI = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $requestURI);
+ $requestURI = \mb_convert_encoding($requestURI, 'UTF-8', 'ISO-8859-1');
}
// some webservers output lower-case encoding (e.g. %c3 instead of %C3)
{
// convert encoding if necessary
if (!StringUtil::isUTF8($keywordString)) {
- $keywordString = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $keywordString);
+ $keywordString = \mb_convert_encoding($keywordString, 'UTF-8', 'ISO-8859-1');
}
// remove bad wildcards
if ($this->responseCharset !== 'UTF-8') {
try {
- $this->body = StringUtil::convertEncoding($this->responseCharset, 'UTF-8', $this->body);
+ $this->body = \mb_convert_encoding($this->body, 'UTF-8', $this->responseCharset);
} catch (Exception | ValueError $e) {
throw new ParsingFailed(
"Could not parse body, due an invalid charset.",
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if (!StringUtil::isUTF8($userAgent)) {
- $userAgent = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $userAgent);
+ $userAgent = \mb_convert_encoding($userAgent, 'UTF-8', 'ISO-8859-1');
}
return \mb_substr($userAgent, 0, 191);
// fix encoding
if (!StringUtil::isUTF8($REQUEST_URI)) {
- $REQUEST_URI = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $REQUEST_URI);
+ $REQUEST_URI = \mb_convert_encoding($REQUEST_URI, 'UTF-8', 'ISO-8859-1');
}
return \mb_substr(FileUtil::unifyDirSeparator($REQUEST_URI), 0, 255);