mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for null/not set client contact passwords
This commit is contained in:
parent
cdcfcf715c
commit
e41228a115
@ -180,7 +180,7 @@ class Request extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Filter the client contact password - if it is sent with ***** we should ignore it!
|
//Filter the client contact password - if it is sent with ***** we should ignore it!
|
||||||
if (isset($contact['password'])) {
|
if (isset($contact['password']) && is_string($contact['password'])) {
|
||||||
if (strlen($contact['password']) == 0) {
|
if (strlen($contact['password']) == 0) {
|
||||||
$input['contacts'][$key]['password'] = '';
|
$input['contacts'][$key]['password'] = '';
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,6 +65,34 @@ class ClientTest extends TestCase
|
|||||||
$this->makeTestData();
|
$this->makeTestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testStoreClientFixes()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
"contacts" => [
|
||||||
|
[
|
||||||
|
"email" => "tenda@gmail.com",
|
||||||
|
"first_name" => "Tenda",
|
||||||
|
"is_primary" => True,
|
||||||
|
"last_name" => "Bavuma",
|
||||||
|
"password" => null,
|
||||||
|
"send_email" => True
|
||||||
|
],
|
||||||
|
],
|
||||||
|
"country_id" => "356",
|
||||||
|
"display_name" => "Tenda Bavuma",
|
||||||
|
"name" => "Tenda Bavuma",
|
||||||
|
"shipping_country_id" => "356",
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->postJson('/api/v1/clients', $data);
|
||||||
|
|
||||||
|
$response->assertStatus(200);
|
||||||
|
}
|
||||||
|
|
||||||
public function testClientMergeContactDrop()
|
public function testClientMergeContactDrop()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -50,6 +50,14 @@ class InvoiceEmailTest extends TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInvalidEmailParsing()
|
||||||
|
{
|
||||||
|
$email = 'illegal@example.com';
|
||||||
|
|
||||||
|
$this->assertTrue(strpos($email, '@example.com') !== false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testClientEmailHistory()
|
public function testClientEmailHistory()
|
||||||
{
|
{
|
||||||
$system_log = new SystemLog();
|
$system_log = new SystemLog();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user