<?php
namespace Moto\Application\Settings\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Moto; class CodeInjection extends AbstractInputFilter { protected $_name = 'settingsWebsite.codeInjection'; public function init() { $this->add(array( 'name' => 'header', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'StringTrim'), array( 'name' => 'Moto\Filter\StripCode', 'options' => array( 'php' => true, 'script' => false, ) ), ), 'continue_if_empty' => true, 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 0, 'max' => 16000, ), ), ), )); $this->add(array( 'name' => 'footer', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'StringTrim'), array( 'name' => 'Moto\Filter\StripCode', 'options' => array( 'php' => true, 'script' => false, ) ), ), 'continue_if_empty' => true, 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 0, 'max' => 16000, ), ), ), )); $this->add(array( 'name' => 'execution', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Boolean'), ), 'continue_if_empty' => true, 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'widget_embed_execution', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Boolean'), ), 'continue_if_empty' => true, 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); } }