Use native booleans for prepared SQL params; stop binding db_get_boolean() values (#1019)

Prepared statements were binding DB-specific boolean literals (`'t'/'f'`) produced by `db_get_boolean()`, which breaks PostgreSQL parameter typing in some paths (notably mailbox creation via handler flows). 

This change standardizes bound boolean parameters to native PHP `true`/`false` (which are then cast to 0/1 which seems to work fine within PDO/PostgreSQL).

fixes https://github.com/postfixadmin/postfixadmin/issues/1017
This commit is contained in:
Copilot authored and GitHub committed 2026-04-23 19:28:01 +01:00
1 parent 2cce49a657
commit ae7339afd4
11 files changed
+57 -51

No files matched your search

+1 -8
View File
@@ -48,14 +48,6 @@ class AliasHandlerTest extends \PHPUnit\Framework\TestCase
$x = new AliasHandler(1, 'admin', true);
$values = [
'localpart' => 'david.test',
'domain' => 'example.com',
'active' => 1,
'address' => 'david.test@example.com',
'goto' => ['dest@example.com']
];
try {
$r = $x->init('david.test@example.com');
$this->fail("Should not see this - example.com is not present");
@@ -101,6 +93,7 @@ class AliasHandlerTest extends \PHPUnit\Framework\TestCase
$ret = $dh->save();
$this->assertTrue($ret);
// Need to add 'admin' as a domain_admin