Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit de8c5fc

Browse filesBrowse files
bug #52457 [Cache][HttpFoundation][Lock] Fix empty username/password for PDO PostgreSQL (HypeMC)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache][HttpFoundation][Lock] Fix empty username/password for PDO PostgreSQL | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Currently [pdo_pgsql has a bug](php/php-src#12423) where the username & password arguments have precedence over the DSN, even thought [according to the docs](https://www.php.net/manual/en/ref.pdo-pgsql.connection.php) it should be the other way. This was recently fixed on PHP's side, but it [won't be available till 8.4](php/php-src#12424). Since the bug is not present when the values passed are `null`, which are the default argument values anyway, this PR changes the default values of the properties to match. Commits ------- 534c34c [Cache][HttpFoundation][Lock] Fix empty username/password for PDO PostgreSQL
2 parents 5c949c1 + 534c34c commit de8c5fc
Copy full SHA for de8c5fc

File tree

Expand file treeCollapse file tree

4 files changed

+11
-11
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+11
-11
lines changed

‎src/Symfony/Component/Cache/Adapter/PdoAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/PdoAdapter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface
3434
private $dataCol = 'item_data';
3535
private $lifetimeCol = 'item_lifetime';
3636
private $timeCol = 'item_time';
37-
private $username = '';
38-
private $password = '';
37+
private $username = null;
38+
private $password = null;
3939
private $connectionOptions = [];
4040
private $namespace;
4141

‎src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@ class PdoSessionHandler extends AbstractSessionHandler
112112
/**
113113
* Username when lazy-connect.
114114
*
115-
* @var string
115+
* @var string|null
116116
*/
117-
private $username = '';
117+
private $username = null;
118118

119119
/**
120120
* Password when lazy-connect.
121121
*
122-
* @var string
122+
* @var string|null
123123
*/
124-
private $password = '';
124+
private $password = null;
125125

126126
/**
127127
* Connection options when lazy-connect.

‎src/Symfony/Component/Lock/Store/PdoStore.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Store/PdoStore.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* Lock metadata are stored in a table. You can use createTable() to initialize
2626
* a correctly defined table.
27-
27+
*
2828
* CAUTION: This store relies on all client and server nodes to have
2929
* synchronized clocks for lock expiry to occur at the correct time.
3030
* To ensure locks don't expire prematurely; the TTLs should be set with enough
@@ -40,8 +40,8 @@ class PdoStore implements PersistingStoreInterface
4040
private $conn;
4141
private $dsn;
4242
private $driver;
43-
private $username = '';
44-
private $password = '';
43+
private $username = null;
44+
private $password = null;
4545
private $connectionOptions = [];
4646

4747
private $dbalStore;

‎src/Symfony/Component/Lock/Store/PostgreSqlStore.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Store/PostgreSqlStore.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class PostgreSqlStore implements BlockingSharedLockStoreInterface, BlockingStore
2929
{
3030
private $conn;
3131
private $dsn;
32-
private $username = '';
33-
private $password = '';
32+
private $username = null;
33+
private $password = null;
3434
private $connectionOptions = [];
3535
private static $storeRegistry = [];
3636

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.