mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-23 03:44:02 +00:00
Fixed crash reports using invalid lastError data
This commit is contained in:
parent
9124513584
commit
d0936329aa
@ -131,34 +131,35 @@ class CrashDump{
|
|||||||
|
|
||||||
private function baseCrash(){
|
private function baseCrash(){
|
||||||
global $lastError;
|
global $lastError;
|
||||||
|
|
||||||
|
$error = (array) error_get_last();
|
||||||
|
$error["trace"] = getTrace(4);
|
||||||
|
$errorConversion = array(
|
||||||
|
E_ERROR => "E_ERROR",
|
||||||
|
E_WARNING => "E_WARNING",
|
||||||
|
E_PARSE => "E_PARSE",
|
||||||
|
E_NOTICE => "E_NOTICE",
|
||||||
|
E_CORE_ERROR => "E_CORE_ERROR",
|
||||||
|
E_CORE_WARNING => "E_CORE_WARNING",
|
||||||
|
E_COMPILE_ERROR => "E_COMPILE_ERROR",
|
||||||
|
E_COMPILE_WARNING => "E_COMPILE_WARNING",
|
||||||
|
E_USER_ERROR => "E_USER_ERROR",
|
||||||
|
E_USER_WARNING => "E_USER_WARNING",
|
||||||
|
E_USER_NOTICE => "E_USER_NOTICE",
|
||||||
|
E_STRICT => "E_STRICT",
|
||||||
|
E_RECOVERABLE_ERROR => "E_RECOVERABLE_ERROR",
|
||||||
|
E_DEPRECATED => "E_DEPRECATED",
|
||||||
|
E_USER_DEPRECATED => "E_USER_DEPRECATED",
|
||||||
|
);
|
||||||
|
$error["fullFile"] = $error["file"];
|
||||||
|
$error["file"] = cleanPath($error["file"]);
|
||||||
|
$error["type"] = isset($errorConversion[$error["type"]]) ? $errorConversion[$error["type"]] : $error["type"];
|
||||||
|
if(($pos = strpos($error["message"], "\n")) !== false){
|
||||||
|
$error["message"] = substr($error["message"], 0, $pos);
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($lastError)){
|
if(isset($lastError)){
|
||||||
$error = $lastError;
|
$this->data["lastError"] = $lastError;
|
||||||
}else{
|
|
||||||
$error = (array) error_get_last();
|
|
||||||
$error["trace"] = getTrace(4);
|
|
||||||
$errorConversion = array(
|
|
||||||
E_ERROR => "E_ERROR",
|
|
||||||
E_WARNING => "E_WARNING",
|
|
||||||
E_PARSE => "E_PARSE",
|
|
||||||
E_NOTICE => "E_NOTICE",
|
|
||||||
E_CORE_ERROR => "E_CORE_ERROR",
|
|
||||||
E_CORE_WARNING => "E_CORE_WARNING",
|
|
||||||
E_COMPILE_ERROR => "E_COMPILE_ERROR",
|
|
||||||
E_COMPILE_WARNING => "E_COMPILE_WARNING",
|
|
||||||
E_USER_ERROR => "E_USER_ERROR",
|
|
||||||
E_USER_WARNING => "E_USER_WARNING",
|
|
||||||
E_USER_NOTICE => "E_USER_NOTICE",
|
|
||||||
E_STRICT => "E_STRICT",
|
|
||||||
E_RECOVERABLE_ERROR => "E_RECOVERABLE_ERROR",
|
|
||||||
E_DEPRECATED => "E_DEPRECATED",
|
|
||||||
E_USER_DEPRECATED => "E_USER_DEPRECATED",
|
|
||||||
);
|
|
||||||
$error["fullFile"] = $error["file"];
|
|
||||||
$error["file"] = cleanPath($error["file"]);
|
|
||||||
$error["type"] = isset($errorConversion[$error["type"]]) ? $errorConversion[$error["type"]] : $error["type"];
|
|
||||||
if(($pos = strpos($error["message"], "\n")) !== false){
|
|
||||||
$error["message"] = substr($error["message"], 0, $pos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data["error"] = $error;
|
$this->data["error"] = $error;
|
||||||
|
@ -142,13 +142,13 @@ namespace pocketmine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gc_disable();
|
gc_disable();
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(-1);
|
||||||
ini_set("allow_url_fopen", 1);
|
ini_set("allow_url_fopen", 1);
|
||||||
ini_set("display_errors", 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set("display_startup_errors", 1);
|
ini_set("display_startup_errors", 1);
|
||||||
ini_set("default_charset", "utf-8");
|
ini_set("default_charset", "utf-8");
|
||||||
|
|
||||||
ini_set("memory_limit", "128M"); //Default
|
ini_set("memory_limit", "256M"); //Default
|
||||||
define("pocketmine\\START_TIME", microtime(true));
|
define("pocketmine\\START_TIME", microtime(true));
|
||||||
|
|
||||||
$opts = getopt("", array("enable-ansi", "disable-ansi", "data:", "plugins:", "no-wizard"));
|
$opts = getopt("", array("enable-ansi", "disable-ansi", "data:", "plugins:", "no-wizard"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user