mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #90 from blkmutt/master
Added validation to prevent saving of masked fields.
This commit is contained in:
commit
2a8b25b208
@ -512,6 +512,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');
|
||||||
|
|
||||||
@ -531,12 +536,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';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$rules[$gateway->id.'_'.$field] = 'required';
|
$rules[$gateway->id.'_'.$field] = 'required|notmasked';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user