RemoveCookiesProcessor.php 920 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of Raven.
  4. *
  5. * (c) Sentry Team
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * This processor removes all the cookies from the request to ensure no sensitive
  12. * informations are sent to the server.
  13. *
  14. * @author Stefano Arlandini <sarlandini@alice.it>
  15. */
  16. final class Raven_Processor_RemoveCookiesProcessor extends Raven_Processor
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function process(&$data)
  22. {
  23. if (isset($data['request'])) {
  24. if (isset($data['request']['cookies'])) {
  25. $data['request']['cookies'] = self::STRING_MASK;
  26. }
  27. if (isset($data['request']['headers']) && isset($data['request']['headers']['Cookie'])) {
  28. $data['request']['headers']['Cookie'] = self::STRING_MASK;
  29. }
  30. }
  31. }
  32. }