| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of Raven. |
| 5 |
* |
| 6 |
* (c) Sentry Team |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* This processor removes the `pre_context`, `context_line` and `post_context` |
| 14 |
* informations from all exceptions captured by an event. |
| 15 |
* |
| 16 |
* @author Stefano Arlandini <sarlandini@alice.it> |
| 17 |
*/ |
| 18 |
class Raven_Processor_SanitizeStacktraceProcessor extends Raven_Processor |
| 19 |
{ |
| 20 |
/** |
| 21 |
* {@inheritdoc} |
| 22 |
*/ |
| 23 |
public function process(&$data) |
| 24 |
{ |
| 25 |
if (!isset($data['exception'], $data['exception']['values'])) { |
| 26 |
return; |
| 27 |
} |
| 28 |
|
| 29 |
foreach ($data['exception']['values'] as &$exception) { |
| 30 |
if (!isset($exception['stacktrace'])) { |
| 31 |
continue; |
| 32 |
} |
| 33 |
|
| 34 |
foreach ($exception['stacktrace']['frames'] as &$frame) { |
| 35 |
unset($frame['pre_context'], $frame['context_line'], $frame['post_context']); |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
|