Skip to content

Commit b098ba7

Browse files
author
Kateryna Kodonenko
committed
Load polyfills correctly for the new sqlite version
1 parent 45f05f5 commit b098ba7

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
require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-lexer.php';
8993
require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php';

0 commit comments

Comments
 (0)