diff --git a/includes/sqlite-database-integration/load.php b/includes/sqlite-database-integration/load.php index c80dcdd7b..dc9ed368d 100644 --- a/includes/sqlite-database-integration/load.php +++ b/includes/sqlite-database-integration/load.php @@ -3,7 +3,7 @@ * Plugin Name: SQLite Database Integration * Description: SQLite database driver drop-in. * Author: The WordPress Team - * Version: 2.1.10 + * Version: 2.1.11 * Requires PHP: 7.0 * Textdomain: sqlite-database-integration * diff --git a/includes/sqlite-database-integration/readme.txt b/includes/sqlite-database-integration/readme.txt index e2e5554b4..fe9c2953a 100644 --- a/includes/sqlite-database-integration/readme.txt +++ b/includes/sqlite-database-integration/readme.txt @@ -4,7 +4,7 @@ Contributors: wordpressdotorg, aristath Requires at least: 6.0 Tested up to: 6.4 Requires PHP: 5.6 -Stable tag: 2.1.10 +Stable tag: 2.1.11 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, database diff --git a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php index 542ee6cc0..055884279 100644 --- a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php +++ b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php @@ -2803,9 +2803,10 @@ private function translate_on_duplicate_key( $table_name ) { $this->rewriter->add( new WP_SQLite_Token( '(', WP_SQLite_Token::TYPE_OPERATOR ) ); $max = count( $conflict_columns ); - foreach ( $conflict_columns as $i => $conflict_column ) { + $i = 0; + foreach ( $conflict_columns as $conflict_column ) { $this->rewriter->add( new WP_SQLite_Token( '"' . $conflict_column . '"', WP_SQLite_Token::TYPE_KEYWORD, WP_SQLite_Token::FLAG_KEYWORD_KEY ) ); - if ( $i !== $max - 1 ) { + if ( ++$i < $max ) { $this->rewriter->add( new WP_SQLite_Token( ',', WP_SQLite_Token::TYPE_OPERATOR ) ); $this->rewriter->add( new WP_SQLite_Token( ' ', WP_SQLite_Token::TYPE_WHITESPACE ) ); }