mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #12371 from appwrite/fix-project-smtp-port-type
fix(project): cast smtpPort to int in response model
This commit is contained in:
@@ -94,7 +94,7 @@ class Project extends Model
|
||||
->addRule('smtpPort', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'SMTP server port',
|
||||
'default' => '',
|
||||
'default' => 0,
|
||||
'example' => 25,
|
||||
])
|
||||
->addRule('smtpUsername', [
|
||||
@@ -225,7 +225,7 @@ class Project extends Model
|
||||
$document->setAttribute('smtpReplyToEmail', $smtp['replyToEmail'] ?? $smtp['replyTo'] ?? ''); // Includes backwards compatibility
|
||||
$document->setAttribute('smtpReplyToName', $smtp['replyToName'] ?? '');
|
||||
$document->setAttribute('smtpHost', $smtp['host'] ?? '');
|
||||
$document->setAttribute('smtpPort', $smtp['port'] ?? '');
|
||||
$document->setAttribute('smtpPort', (int) ($smtp['port'] ?? 0));
|
||||
$document->setAttribute('smtpUsername', $smtp['username'] ?? '');
|
||||
$document->setAttribute('smtpPassword', ''); // Write-only: never expose the stored value
|
||||
$document->setAttribute('smtpSecure', $smtp['secure'] ?? '');
|
||||
|
||||
@@ -103,7 +103,7 @@ class ProjectConsoleClientTest extends Scope
|
||||
$this->assertSame('', $response['body']['smtpReplyToEmail']);
|
||||
$this->assertSame('', $response['body']['smtpReplyToName']);
|
||||
$this->assertSame('', $response['body']['smtpHost']);
|
||||
$this->assertSame('', $response['body']['smtpPort']);
|
||||
$this->assertSame(0, $response['body']['smtpPort']);
|
||||
$this->assertSame('', $response['body']['smtpUsername']);
|
||||
$this->assertSame('', $response['body']['smtpPassword']);
|
||||
$this->assertSame('', $response['body']['smtpSecure']);
|
||||
|
||||
Reference in New Issue
Block a user