mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:14:40 -04:00
Updated validation to avoid saving masked fields.
This commit is contained in:
parent
a7e0ca0d60
commit
33b90241a2
@ -483,6 +483,11 @@ class AccountController extends \BaseController {
|
|||||||
|
|
||||||
private function savePayments()
|
private function savePayments()
|
||||||
{
|
{
|
||||||
|
Validator::extend('notmasked', function($attribute, $value, $parameters)
|
||||||
|
{
|
||||||
|
return $value != str_repeat('*', strlen($value));
|
||||||
|
});
|
||||||
|
|
||||||
$rules = array();
|
$rules = array();
|
||||||
$recommendedId = Input::get('recommendedGateway_id');
|
$recommendedId = Input::get('recommendedGateway_id');
|
||||||
|
|
||||||
@ -502,14 +507,12 @@ class AccountController extends \BaseController {
|
|||||||
{
|
{
|
||||||
if(in_array($field, ['merchant_id', 'passCode']))
|
if(in_array($field, ['merchant_id', 'passCode']))
|
||||||
{
|
{
|
||||||
$rules[$gateway->id.'_'.$field] = 'required';
|
$rules[$gateway->id.'_'.$field] = 'required|notmasked';
|
||||||
$rules[$gateway->id.'_'.$field] = 'match:/?![*]+/';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$rules[$gateway->id.'_'.$field] = 'required';
|
$rules[$gateway->id.'_'.$field] = 'required|notmasked';
|
||||||
$rules[$gateway->id.'_'.$field] = 'match:/?![*]+/';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user