From 91d769441efe3d0a0323d23feb763a522025ca3f Mon Sep 17 00:00:00 2001 From: Nick Chomey <88559987+nickchomey@users.noreply.github.com> Date: Wed, 28 Oct 2026 09:53:05 -0600 Subject: [PATCH 1/2] fix: resolve recorded db-path.php secret path for SQLite file operations sqlite-database-integration 3.1 stores the database at a randomized path recorded in FQDBDIR/db-path.php when nothing explicit is configured. Teach get_sqlite_db_path() to consult that file after the explicit constants, so file operations target the real database instead of a legacy path. An explicitly configured DB_FILE takes precedence over the recorded path, matching the drop-in, and a recorded :memory: database is refused like the other in-memory configurations. Add a Behat scenario covering the recorded secret path with a legacy decoy database. --- features/db-sqlite-path.feature | 39 +++++++++++++++++++++++++++++++++ src/DB_Command_SQLite.php | 24 +++++++++++++++++--- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/features/db-sqlite-path.feature b/features/db-sqlite-path.feature index 37e7de1d..29dcffa6 100644 --- a/features/db-sqlite-path.feature +++ b/features/db-sqlite-path.feature @@ -61,6 +61,45 @@ Feature: Select the configured SQLite database for file operations | | selected.sqlite | | | | | | | | selected.sqlite | / | + Scenario: Resolve the recorded secret path from db-path.php + Given a WP install + When I run `wp eval 'mkdir( "recorded" ); copy( defined( "DB_PATH" ) ? DB_PATH : FQDB, "recorded/selected.sqlite" ); copy( "recorded/selected.sqlite", ".ht.sqlite" ); file_put_contents( "recorded/db-path.php", " Date: Wed, 28 Oct 2026 12:26:08 -0600 Subject: [PATCH 2/2] test(db-command): cover recorded path without loading the drop-in --- features/db-sqlite-path.feature | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/features/db-sqlite-path.feature b/features/db-sqlite-path.feature index 29dcffa6..c6b6d930 100644 --- a/features/db-sqlite-path.feature +++ b/features/db-sqlite-path.feature @@ -100,6 +100,39 @@ Feature: Select the configured SQLite database for file operations {OTHER_HASH} """ + @require-sqlite + Scenario: Resolve the recorded secret path without loading the drop-in + Given a WP install + When I run `wp eval 'mkdir( "recorded" ); copy( defined( "DB_PATH" ) ? DB_PATH : FQDB, "recorded/selected.sqlite" ); copy( "recorded/selected.sqlite", ".ht.sqlite" ); file_put_contents( "recorded/db-path.php", "