19 declare(strict_types=1);
47 array $sensitive_data = []
55 foreach ($key_value_pairs as
$key => &$value) {
56 if (is_array($value)) {
60 if (is_string($value) && in_array(
$key, $this->sensitive_data,
true)) {
61 $value =
'REMOVED FOR SECURITY';
64 if (
$key ===
'PHPSESSID' && is_string($value)) {
65 $value = substr($value, 0, 5) .
' (SHORTENED FOR SECURITY)';
68 if (
$key ===
'HTTP_COOKIE') {
69 $cookie_content = explode(
';', $value);
70 foreach ($cookie_content as &$cookie_pair_string) {
71 $cookie_pair = explode(
'=', $cookie_pair_string);
72 if (trim($cookie_pair[0]) === session_name()) {
73 $cookie_pair[1] = substr($cookie_pair[1], 0, 5) .
' (SHORTENED FOR SECURITY)';
74 $cookie_pair_string = implode(
'=', $cookie_pair);
77 $value = implode(
';', $cookie_content);
81 return $key_value_pairs;
93 if (defined(
"IL_INITIAL_WD")) {
107 $this->current_handler = $this->error_handling->getHandler();
108 $this->current_handler->setRun($this->getRun());
109 $this->current_handler->setException($this->getException());
110 $this->current_handler->setInspector($this->getInspector());
111 return $this->current_handler->handle();
120 if ($this->current_handler === null ||
121 !method_exists($this->current_handler,
'contentType')) {
125 return $this->current_handler->contentType();
contentType()
This is an implicit interface method of the Whoops handlers.
handle()
Last missing method from HandlerInterface.
__construct(ilErrorHandling $error_handling, array $sensitive_data=[])
HandlerInterface $current_handler
A Whoops error handler that delegates calls on it self to another handler that is created only in the...
Error Handling & global info handling uses PEAR error class.
ilErrorHandling $error_handling
hideSensitiveData(array $key_value_pairs)