You are here

RavenSanitizeCookieProcessor.php in Raven: Sentry Integration 7.3

Extend SanitizeDataProcessor to sanitize cookies.

File

RavenSanitizeCookieProcessor.php
View source
<?php

/**
 * @file
 * Extend SanitizeDataProcessor to sanitize cookies.
 */

/**
 * Extend SanitizeDataProcessor to sanitize cookies.
 */
class RavenSanitizeCookieProcessor extends Raven_Processor_SanitizeDataProcessor {

  /**
   * {@inheritdoc}
   */
  public function process(&$data) {
    if (!empty($data['request'])) {
      $this
        ->sanitizeHttp($data);
    }
  }

  /**
   * Sanitize cookies.
   */
  public function sanitizeHttp(&$data) {
    $http =& $data['request'];
    if (!empty($http['cookies']) && is_array($http['cookies'])) {
      $cookies =& $http['cookies'];
      array_walk_recursive($cookies, array(
        $this,
        'sanitize',
      ));
    }
  }

}

Classes

Namesort descending Description
RavenSanitizeCookieProcessor Extend SanitizeDataProcessor to sanitize cookies.