public function __construct($session, HDIVConfig $HDIVConfig) { $this->session = $session; $this->maxPagesPerSession = $HDIVConfig->getMaxPagesPerSession(); $this->stateCache = $this->session->get('StateCache'); $this->HDIVConfig = $HDIVConfig; if (!isset($this->stateCache)) { $this->stateCache = new StateCache(); } }
/** * Checks if <code>$in</code> is a non malicious string with ModSecurity rules * @param $in * @return matched rule, otherwise false */ private function editableRuleValidation($fieldValue, HDIVConfig $HDIVConfig) { $defaultBlackListRules = $HDIVConfig->getDefaultRules(); foreach ($defaultBlackListRules as $key => $rule) { if (preg_match($rule, $fieldValue)) { return $key; } } return false; }