diff --git a/db.php b/db.php index 6fff34a..4c665c2 100644 --- a/db.php +++ b/db.php @@ -5,7 +5,7 @@ * This file must be placed in the directory wordpress/wp-content/db.php. * WordPress loads this file automatically. * - * @version 1.6.1 + * @version 1.6.2 * @package SQLite Integration * @author Kojima Toshiyasu * diff --git a/pdodb.class.php b/pdodb.class.php index 427d89f..b7df54c 100644 --- a/pdodb.class.php +++ b/pdodb.class.php @@ -200,6 +200,8 @@ class PDODB extends wpdb { $this->bail(sprintf(__("
We have been unable to connect to the specified database.
The error message received was %s"), $this->dbh->errorInfo()));
return;
}
+ $is_enabled_foreign_keys = @$this->get_var('PRAGMA foreign_keys');
+ if ($is_enabled_foreign_keys == '0') @$this->query('PRAGMA foreign_keys = ON');
$this->ready = true;
}
/**
@@ -333,7 +335,5 @@ class PDODB extends wpdb {
if (!isset($wpdb)) {
global $wpdb;
$wpdb = new PDODB();
- $is_enabled_foreign_keys = @$wpdb->get_var('PRAGMA foreign_keys');
- if ($is_enabled_foreign_keys == '0') @$wpdb->query('PRAGMA foreign_keys = ON');
}
?>
\ No newline at end of file
diff --git a/pdoengine.class.php b/pdoengine.class.php
index 1f2fee9..5caa6da 100644
--- a/pdoengine.class.php
+++ b/pdoengine.class.php
@@ -781,9 +781,9 @@ class PDOEngine extends PDO {
if (stripos($this->query_type, 'show') !== false) {
if (stripos($this->query_type, 'show table status') !== false) {
$this->query_type = 'showstatus';
- } elseif (stripos($this->query_type, 'show tables') !== false) {
+ } elseif (stripos($this->query_type, 'show tables') !== false || stripos($this->query_type, 'show full tables') !== false) {
$this->query_type = 'show';
- } elseif (stripos($this->query_type, 'show columns') !== false || stripos($this->query_type, 'show fields') !== false) {
+ } elseif (stripos($this->query_type, 'show columns') !== false || stripos($this->query_type, 'show fields') !== false || stripos($this->query_type, 'show full columns') !== false) {
$this->query_type = 'showcolumns';
} elseif (stripos($this->query_type, 'show index') !== false || stripos($this->query_type, 'show indexes') !== false || stripos($this->query_type, 'show keys') !== false) {
$this->query_type = 'showindex';
diff --git a/query.class.php b/query.class.php
index 2ff310c..733533f 100644
--- a/query.class.php
+++ b/query.class.php
@@ -146,7 +146,7 @@ class PDOSQLiteDriver {
* @access private
*/
private function parse_query() {
- $tokens = preg_split("/(''|')/s", $this->_query, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $tokens = preg_split("/(\\\'|''|')/s", $this->_query, -1, PREG_SPLIT_DELIM_CAPTURE);
$literal = false;
$query_string = '';
foreach ($tokens as $token) {
@@ -161,12 +161,12 @@ class PDOSQLiteDriver {
if (strpos($token, '`') !== false) {
$token = str_replace('`', '', $token);
}
- if (stripos($token, 'TRUE') !== false) {
- $token = str_ireplace('TRUE', '1', $token);
- }
- if (stripos($token, 'FALSE') !== false) {
- $token = str_ireplace('FALSE', '0', $token);
- }
+ if (preg_match('/\\bTRUE\\b/i', $token)) {
+ $token = str_ireplace('TRUE', '1', $token);
+ }
+ if (preg_match('/\\bFALSE\\b/i', $token)) {
+ $token = str_ireplace('FALSE', '0', $token);
+ }
if (stripos($token, 'SQL_CALC_FOUND_ROWS') !== false) {
$this->rewrite_calc_found = true;
}
@@ -197,6 +197,7 @@ class PDOSQLiteDriver {
* @access private
*/
private function handle_show_query(){
+ $this->_query = str_ireplace(' FULL', '', $this->_query);
$table_name = '';
$pattern = '/^\\s*SHOW\\s*TABLES\\s*.*?(LIKE\\s*(.*))$/im';
if (preg_match($pattern, $this->_query, $matches)) {
@@ -538,6 +539,7 @@ class PDOSQLiteDriver {
* @access private
*/
private function handle_show_columns_query() {
+ $this->_query = str_ireplace(' FULL', '', $this->_query);
$pattern_like = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?\\s*LIKE\\s*(.*)?/i';
$pattern = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?/i';
if (preg_match($pattern_like, $this->_query, $matches)) {
diff --git a/query_create.class.php b/query_create.class.php
index 9cb6e28..2a37ad5 100644
--- a/query_create.class.php
+++ b/query_create.class.php
@@ -70,6 +70,7 @@ class CreateQuery{
// we don't use it for now.
return $this->_query;
}
+ $this->strip_backticks();
$this->get_table_name();
$this->rewrite_comments();
$this->rewrite_field_types();
@@ -84,7 +85,6 @@ class CreateQuery{
$this->rewrite_set();
$this->rewrite_key();
$this->add_if_not_exists();
- $this->strip_backticks();
return $this->post_process();
}
diff --git a/readme-ja.txt b/readme-ja.txt
index 834273f..75ea9e0 100644
--- a/readme-ja.txt
+++ b/readme-ja.txt
@@ -7,7 +7,7 @@ Author: Kojima Toshiyasu
Author URI: http://dogwood.skr.jp/
Requires at least: 3.3
Tested up to: 3.9
-Stable tag: 1.6
+Stable tag: 1.6.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -161,6 +161,10 @@ query_posts() や WP_Query() を使うときに、オプションの一部が機
== Changelog ==
+= 1.6.2 (2014-05-05) =
+* 正規表現に関するバグを修正しました。
+* 管理画面のドキュメント(表示されていなかった)を修正しました。
+
= 1.6.1 (2014-04-22) =
* WP Slimstat を使うために、いくつかのバグを修正しました。
* 古い db.php を使い続けている場合は、ダッシュボードに注意を表示するようにしました(必要な場合のみ)。
diff --git a/readme.txt b/readme.txt
index ab3f5c5..939aed6 100644
--- a/readme.txt
+++ b/readme.txt
@@ -7,7 +7,7 @@ Author: Kojima Toshiyasu
Author URI: http://dogwood.skr.jp/
Requires at least: 3.3
Tested up to: 3.9
-Stable tag: 1.6.1
+Stable tag: 1.6.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -159,6 +159,10 @@ When query_posts() or WP_Query() is used, some options didn't work properly. Whe
== Changelog ==
+= 1.6.2 (2014-05-05) =
+* Fixed some bugs for the regular expression.
+* Fixed the documents on the admin dashboard.
+
= 1.6.1 (2014-04-22) =
* Fixed some bugs for using with WP Slimstat plugin.
* Display admin notice when not replacing the old db.php with the new one (when necessary).
diff --git a/sqlite-integration.php b/sqlite-integration.php
index 17d7588..d368dbc 100644
--- a/sqlite-integration.php
+++ b/sqlite-integration.php
@@ -4,7 +4,7 @@ Plugin Name: SQLite Integration
Plugin URI: http://dogwood.skr.jp/wordpress/sqlite-integration/
Description: SQLite Integration is the plugin that enables WordPress to use SQLite. If you don't have MySQL and want to build a WordPress website, it's for you.
Author: Kojima Toshiyasu
-Version: 1.6.1
+Version: 1.6.2
Author URI: http://dogwood.skr.jp
Text Domain: sqlite-integration
Domain Path: /languages
@@ -44,7 +44,7 @@ $siteurl = get_option('siteurl');
/*
* Defines basic constants.
*/
-define('SQLITE_INTEGRATION_VERSION', '1.6.1');
+define('SQLITE_INTEGRATION_VERSION', '1.6.2');
define('SQLiteDir', dirname(plugin_basename(__FILE__)));
define('SQLiteFilePath', dirname(__FILE__));
define('SQLiteDirName', basename(SQLiteFilePath));
diff --git a/utilities/plugin_lists.json b/utilities/plugin_lists.json
index 9fe8245..1b1be44 100644
--- a/utilities/plugin_lists.json
+++ b/utilities/plugin_lists.json
@@ -101,8 +101,10 @@
{
"name":"Broken Link Checker",
- "compat":"Checked",
- "class":"compatible"
+ "compat":"Needs Patch",
+ "patch_url":"http://dogwood.skr.jp/wordpress/plugins/",
+ "reason":"MySQL function",
+ "class":"workaround"
},
{
diff --git a/utilities/utility.php b/utilities/utility.php
index d719b10..dd08322 100644
--- a/utilities/utility.php
+++ b/utilities/utility.php
@@ -31,12 +31,15 @@ class SQLiteIntegrationUtils {
* Check if db.php file is replaced with the apropriate version,
* and if not, display notice.
*
+ * This is not required for now. So this method only returns and
+ * do nothing.
*
*/
public static function show_admin_notice() {
+ return;
$notice_string = __('Upgrading Notice: To finish upgrading, please activate SQLite Integration and go Setting >> SQLite Integration >> Miscellaneous, and click the button "update" at the bottom of the page. Or else replace wp-content/db.php with the one in sqlite-integration directory manually.', 'sqlite-integration');
$current_version = defined('SQLITE_INTEGRATION_VERSION') ? SQLITE_INTEGRATION_VERSION : '';
- if (version_compare($current_version, '1.6.1', '=')) return;
+ if (version_compare($current_version, '1.6.2', '=')) return;
$version = '';
if (defined('WP_CONTENT_DIR')) {
$path = WP_CONTENT_DIR . '/db.php';
@@ -932,8 +935,13 @@ class SQLiteIntegrationUtils {
$message = __('Couldn"t update db.php file. Please replace it manually.', $domain);
echo '