try to prevent utf-8 related error
This commit is contained in:
parent
4e1983b06a
commit
8822c79108
@ -59,29 +59,29 @@ class ErrorHandler {
|
|||||||
$this->maniaControl->log($logMessage);
|
$this->maniaControl->log($logMessage);
|
||||||
|
|
||||||
if (!DEV_MODE) {
|
if (!DEV_MODE) {
|
||||||
$error = array();
|
$report = array();
|
||||||
$error['Type'] = 'Exception';
|
$report['Type'] = 'Exception';
|
||||||
$error['Message'] = $message;
|
$report['Message'] = iconv('UTF-8', 'UTF-8//TRANSLIT', $message);
|
||||||
$error['Class'] = $exceptionClass;
|
$report['Class'] = $exceptionClass;
|
||||||
$error['FileLine'] = $exception->getFile() . ': ' . $exception->getLine();
|
$report['FileLine'] = $exception->getFile() . ': ' . $exception->getLine();
|
||||||
$error['SourceClass'] = $sourceClass;
|
$report['SourceClass'] = $sourceClass;
|
||||||
$error['PluginId'] = PluginManager::getPluginId($sourceClass);
|
$report['PluginId'] = PluginManager::getPluginId($sourceClass);
|
||||||
$error['Backtrace'] = $traceString;
|
$report['Backtrace'] = iconv('UTF-8', 'UTF-8//TRANSLIT', $traceString);
|
||||||
$error['OperatingSystem'] = php_uname();
|
$report['OperatingSystem'] = php_uname();
|
||||||
$error['PHPVersion'] = phpversion();
|
$report['PHPVersion'] = phpversion();
|
||||||
|
|
||||||
if ($this->maniaControl->server) {
|
if ($this->maniaControl->server) {
|
||||||
$error['ServerLogin'] = $this->maniaControl->server->login;
|
$report['ServerLogin'] = $this->maniaControl->server->login;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
|
if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
|
||||||
$error['UpdateChannel'] = $this->maniaControl->settingManager->getSettingValue($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
|
$report['UpdateChannel'] = $this->maniaControl->settingManager->getSettingValue($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
|
||||||
$error['ManiaControlVersion'] = ManiaControl::VERSION . ' #' . $this->maniaControl->updateManager->getNightlyBuildDate();
|
$report['ManiaControlVersion'] = ManiaControl::VERSION . ' #' . $this->maniaControl->updateManager->getNightlyBuildDate();
|
||||||
} else {
|
} else {
|
||||||
$error['ManiaControlVersion'] = ManiaControl::VERSION;
|
$report['ManiaControlVersion'] = ManiaControl::VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
$json = json_encode($error);
|
$json = json_encode($report);
|
||||||
$info = base64_encode($json);
|
$info = base64_encode($json);
|
||||||
|
|
||||||
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
|
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
|
||||||
@ -225,28 +225,28 @@ class ErrorHandler {
|
|||||||
$this->maniaControl->log($logMessage);
|
$this->maniaControl->log($logMessage);
|
||||||
|
|
||||||
if (!DEV_MODE && !$userError && !$suppressed) {
|
if (!DEV_MODE && !$userError && !$suppressed) {
|
||||||
$error = array();
|
$report = array();
|
||||||
$error['Type'] = 'Error';
|
$report['Type'] = 'Error';
|
||||||
$error['Message'] = $message;
|
$report['Message'] = iconv('UTF-8', 'UTF-8//TRANSLIT', $message);
|
||||||
$error['FileLine'] = $fileLine;
|
$report['FileLine'] = $fileLine;
|
||||||
$error['SourceClass'] = $sourceClass;
|
$report['SourceClass'] = $sourceClass;
|
||||||
$error['PluginId'] = PluginManager::getPluginId($sourceClass);
|
$report['PluginId'] = PluginManager::getPluginId($sourceClass);
|
||||||
$error['Backtrace'] = $traceString;
|
$report['Backtrace'] = iconv('UTF-8', 'UTF-8//TRANSLIT', $traceString);
|
||||||
$error['OperatingSystem'] = php_uname();
|
$report['OperatingSystem'] = php_uname();
|
||||||
$error['PHPVersion'] = phpversion();
|
$report['PHPVersion'] = phpversion();
|
||||||
|
|
||||||
if ($this->maniaControl->server) {
|
if ($this->maniaControl->server) {
|
||||||
$error['ServerLogin'] = $this->maniaControl->server->login;
|
$report['ServerLogin'] = $this->maniaControl->server->login;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
|
if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
|
||||||
$error['UpdateChannel'] = $this->maniaControl->settingManager->getSettingValue($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
|
$report['UpdateChannel'] = $this->maniaControl->settingManager->getSettingValue($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
|
||||||
$error['ManiaControlVersion'] = ManiaControl::VERSION . ' ' . $this->maniaControl->updateManager->getNightlyBuildDate();
|
$report['ManiaControlVersion'] = ManiaControl::VERSION . ' ' . $this->maniaControl->updateManager->getNightlyBuildDate();
|
||||||
} else {
|
} else {
|
||||||
$error['ManiaControlVersion'] = ManiaControl::VERSION;
|
$report['ManiaControlVersion'] = ManiaControl::VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
$json = json_encode($error);
|
$json = json_encode($report);
|
||||||
$info = base64_encode($json);
|
$info = base64_encode($json);
|
||||||
|
|
||||||
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
|
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
|
||||||
|
Loading…
Reference in New Issue
Block a user