firefly-iii/app/lib/FireflyIII/Shared/Validation/FireflyValidator.php
2014-12-13 21:59:02 +01:00

29 lines
582 B
PHP

<?php
namespace FireflyIII\Shared\Validation;
use Illuminate\Validation\Validator;
/**
* Class FireflyValidator
*
* @package FireflyIII\Shared\Validation
*/
class FireflyValidator extends Validator
{
/**
* @param $attribute
* @param $value
* @param $parameters
*
* @return bool
*/
public function validateAlphabasic($attribute, $value, $parameters)
{
$pattern = '/[^[:alnum:]_\-\.\& \(\)\'"]/iu';
if (preg_match($pattern, $value)) {
return false;
} else {
return true;
}
}
}