<?php
 namespace Moto\Application\FileManager\InputFilter; use Moto\Application\FileManager; use Moto\InputFilter\AbstractInputFilter; use Moto; class Rename extends AbstractInputFilter { protected $_name = 'fileManager.rename'; public function init() { $this->add(array( 'name' => 'source', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), array('name' => 'Moto\Filter\RelativePath'), array('name' => 'Moto\Application\FileManager\Filter\UploadsDir'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 300, ), 'break_chain_on_failure' => true ), array( 'name' => 'Moto\Application\FileManager\Validator\PathExists', ) ), )); $info = Moto\Application\FileManager\Service::getInfo(); $this->add(array( 'name' => 'target', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), array('name' => 'BaseName') ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 300, ), 'break_chain_on_failure' => true ), array( 'name' => 'Moto\Application\FileManager\Validator\ExcludeExtension', 'options' => array( 'extension' => $info['allowed_ext_list'] ) ) ), )); } } 