mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Add BIC support. This fixes #430
This commit is contained in:
@@ -57,8 +57,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
*
|
||||
* @return bool
|
||||
* @internal param $parameters
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function validate2faCode($attribute, $value): bool
|
||||
@@ -95,6 +93,27 @@ class FireflyValidator extends Validator
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
public function validateBic($attribute, $value): bool
|
||||
{
|
||||
$regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i';
|
||||
$result = preg_match($regex, $value);
|
||||
if ($result === false) {
|
||||
return false;
|
||||
}
|
||||
if ($result === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
|
Reference in New Issue
Block a user