Skip to content

Commit 2038ecc

Browse files
author
Kateryna Kodonenko
committed
Load polyfills correctly for the new sqlite version
1 parent 2636429 commit 2038ecc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/SQLiteDatabaseIntegrationLoader.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ public static function load_plugin() {
8383
}
8484

8585
// We also need to selectively load the necessary classes from the plugin.
86-
require_once $plugin_directory . '/php-polyfills.php';
86+
// In v2.2.22+, php-polyfills.php moved to wp-includes/database/php-polyfills.php.
87+
$polyfills_path = file_exists( $plugin_directory . '/wp-includes/database/php-polyfills.php' )
88+
? $plugin_directory . '/wp-includes/database/php-polyfills.php'
89+
: $plugin_directory . '/php-polyfills.php';
90+
require_once $polyfills_path;
8791
require_once $plugin_directory . '/constants.php';
8892

8993
$new_driver_enabled = defined( 'WP_SQLITE_AST_DRIVER' ) && WP_SQLITE_AST_DRIVER;

0 commit comments

Comments
 (0)