| Server IP : 185.252.147.100 / Your IP : 216.73.216.43 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/kanboard/app/Validator/ |
Upload File : |
<?php
namespace Kanboard\Validator;
use Kanboard\Core\Base;
use SimpleValidator\Validators;
/**
* Base Validator
*
* @package Kanboard\Validator
* @author Frederic Guillot
*/
abstract class BaseValidator extends Base
{
/**
* Execute multiple validators
*
* @access public
* @param array $validators List of validators
* @param array $values Form values
* @return array $valid, $errors [0] = Success or not, [1] = List of errors
*/
public function executeValidators(array $validators, array $values)
{
$result = false;
$errors = array();
foreach ($validators as $method) {
list($result, $errors) = $this->$method($values);
if (! $result) {
break;
}
}
return array($result, $errors);
}
/**
* Common password validation rules
*
* @access protected
* @return array
*/
protected function commonPasswordValidationRules()
{
return array(
new Validators\Required('password', t('The password is required')),
new Validators\MinLength('password', t('The minimum length is %d characters', 6), 6),
new Validators\Required('confirmation', t('The confirmation is required')),
new Validators\Equals('password', 'confirmation', t('Passwords don\'t match')),
);
}
}