mirror of
https://github.com/filp/whoops.git
synced 2026-08-30 20:17:11 +00:00
Added array_key_exists check
Added array_key_exists check to check for misconfigured environments like Google App Engine
This commit is contained in:
@@ -32,9 +32,11 @@ class Misc
|
||||
public static function translateErrorCode($error_code)
|
||||
{
|
||||
$constants = get_defined_constants(true);
|
||||
foreach ($constants['Core'] as $constant => $value) {
|
||||
if (substr($constant, 0, 2) == 'E_' && $value == $error_code) {
|
||||
return $constant;
|
||||
if (array_key_exists('Core' , $constants)) {
|
||||
foreach ($constants['Core'] as $constant => $value) {
|
||||
if (substr($constant, 0, 2) == 'E_' && $value == $error_code) {
|
||||
return $constant;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "E_UNKNOWN";
|
||||
|
||||
Reference in New Issue
Block a user