You are here

public function AuthcacheP13nSettingBuilder::validate in Authenticated User Page Caching (Authcache) 7.2

Validate and sanitize a request.

Implementations must throw an AuthcacheP13nRequestInvalidInput exception when params contain invalid or unexpected values.

Parameters

array $params: The GET parameters in key-value form

Return value

array Sanitized GET parameters used in subsequent processing

Throws

AuthcacheP13nRequestInvalidInput

Overrides AuthcacheP13nRequestValidatorInterface::validate

File

modules/authcache_p13n/includes/AuthcacheP13nSettingBuilder.inc, line 34
Defines AuthcacheP13nSettingBuilder.

Class

AuthcacheP13nSettingBuilder
Content builder for personalized Drupal.settings.

Code

public function validate($req) {

  // Run setting request validators.
  if (!empty($req['a']) && is_array($req['a'])) {
    foreach ($req['a'] as $paramname => $params) {
      if (!empty($this->settings[$paramname]['validator'])) {
        $req['a'][$paramname] = $this->settings[$paramname]['validator']
          ->validate($params);
      }
    }
  }
  return $req;
}