| 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 all the data of the HTTP body to ensure no sensitive |
| 14 |
* informations are sent to the server in case the request method is POST, PUT, |
| 15 |
* PATCH or DELETE. |
| 16 |
* |
| 17 |
* @author Stefano Arlandini <sarlandini@alice.it> |
| 18 |
*/ |
| 19 |
final class Raven_Processor_RemoveHttpBodyProcessor extends Raven_Processor |
| 20 |
{ |
| 21 |
/** |
| 22 |
* {@inheritdoc} |
| 23 |
*/ |
| 24 |
public function process(&$data) |
| 25 |
{ |
| 26 |
if (isset($data['request'], $data['request']['method']) && in_array(strtoupper($data['request']['method']), array('POST', 'PUT', 'PATCH', 'DELETE'))) { |
| 27 |
$data['request']['data'] = self::STRING_MASK; |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|