public function AuthcacheP13nFragmentAssemblyBuilder::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/ AuthcacheP13nFragmentAssemblyBuilder.inc, line 34 - Defines AuthcacheP13nFragmentAssemblyBuilder.
Class
- AuthcacheP13nFragmentAssemblyBuilder
- Content builder for personalized fragment assemblies.
Code
public function validate($req) {
// Normalize request parameters.
foreach ($req['a'] as $paramname => $params) {
$params = empty($params) ? array() : static::mapAssoc($params);
// Run validators.
if (!empty($this->partials[$paramname]['validator'])) {
$params = $this->partials[$paramname]['validator']
->validate($params);
}
$req['a'][$paramname] = $params;
}
return $req;
}