Changed _rewrite_between() function. Added some plugins to the plugin compatiblity list. Fixed the server check message.

git-svn-id: https://plugins.svn.wordpress.org/sqlite-integration/trunk@779068 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
kjmtsh 2013-09-27 03:45:59 +00:00
parent cfc1d0b2ef
commit 295ea862d2
6 changed files with 59 additions and 7 deletions

View File

@ -57,7 +57,9 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated =
wp_cache_flush();
if ((isset($_SERVER['SERVER_NAME']) && stripos('apache', $_SERVER['SERVER_NAME']) === false) || (isset($_SERVER['SERVER_SIGNATURE']) && stripos('apache', $_SERVER['SERVER_SIGNATURE']) === false)) {
if (isset($_SERVER['SERVER_NAME']) && stripos($_SERVER['SERVER_NAME'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) {
;// Your server is Apache. Nothing to do more.
} else {
$server_message = sprintf('Your webserver doesn\'t seem to be Apache. So the database directory access restriction by the .htaccess file may not function. We strongly recommend that you should restrict the access to the directory %s in some other way.', FQDBDIR);
echo '<div style="position: absolute; margin-top: 250px; width: 700px; border: .5px dashed rgb(0, 0, 0);"><p style="margin: 10px;">';
echo $server_message;

View File

@ -54,7 +54,7 @@ class PDOSQLiteDriver {
$this->_rewrite_regexp();
$this->_rewrite_boolean();
$this->_fix_date_quoting();
// $this->_rewrite_between();
$this->_rewrite_between();
break;
case 'insert':
$this->_strip_backticks();
@ -70,7 +70,7 @@ class PDOSQLiteDriver {
$this->_rewrite_limit_usage();
$this->_rewrite_order_by_usage();
$this->_rewrite_regexp();
// $this->_rewrite_between();
$this->_rewrite_between();
break;
case 'delete':
$this->_strip_backticks();
@ -503,8 +503,28 @@ class PDOSQLiteDriver {
$column_name = trim($match[1]);
$min_value = trim($match[2]);
$max_value = trim($match[3]);
$replacement = " $column_name >= '$min_value' AND $column_name <= '$max_value'";
$this->_query = str_ireplace($match[0], $replacement, $this->_query);
$max_value = rtrim($max_value);
$tokens = preg_split("/(''|'|,|)/s", $this->_query, -1, PREG_SPLIT_DELIM_CAPTURE);
$literal = false;
$rewriting = false;
foreach ($tokens as $token) {
if (strpos($token, "'") !== false) {
if ($literal) {
$literal = false;
} else {
$literal = true;
}
} else {
if ($literal === false && stripos($token, 'between') !== false) {
$rewriting = true;
break;
}
}
}
if ($rewriting) {
$replacement = " $column_name >= '$min_value' AND $column_name <= '$max_value'";
$this->_query = str_ireplace($match[0], $replacement, $this->_query);
}
}
}
/**

View File

@ -174,6 +174,13 @@ SQLite Integrationのアップグレードに失敗するようなら、FTPを
== Changelog ==
= 1.4.1 (2013-09-27) =
* BETWEEN関数の書き換え方を修正しました。致命的なバグです。新規投稿に'between A and B'というフレーズが含まれていると、公開されず、投稿自体も消えます。
* MP6を使っているときに、管理画面のレイアウトが崩れるのを修正しました。
* 日本語が一部表示されないのを直しました。
* SELECT version()がダミーデータを返すようにしました。
* WP_DEBUGが有効の時に、WordPressのテーブルからカラム情報を読んで表示できるようにしました。
= 1.4 (2013-09-12) =
* アップグレードしたWordPressで期待通り動作しないのを修正するために、データベース管理ユーティリティを追加しました。
* SHOW INDEXクエリにWHERE句がある場合の処理を変更しました。

View File

@ -165,8 +165,15 @@ When auto upgrading of SQLite Integration fails, please try manual upgrade via F
== Changelog ==
= 1.4.1 (2013-09-27) =
* Fixed the rewriting process of BETWEEN function. This is a critical bug. When your newly created post contains 'between A and B' phrase, it is not published and disappears.
* Fixed the admin dashboard display when using MP6.
* Fixed the Japanese catalog.
* Added the procedure for returning the dummy data when using SELECT version().
* Added the procedure for displaying column informatin of WordPress tables when WP_DEBUG enabled.
= 1.4 (2013-09-12) =
* Added the database maintenance utility for fixing the database mulfunction of the upgraded WordPress installation.
* Added the database maintenance utility for fixing the database malfunction of the upgraded WordPress installation.
* Changed the manipulation of SHOW INDEX query with WHERE clause.
* Fixed the bug of the manipulation of ALTER TABLE query.

View File

@ -435,6 +435,8 @@ class DatabaseMaintenance {
<input type="submit" name="sanity-check" class="button-primary" value="<?php _e('Sanity Check', $domain);?>" onclick="return confirm('<?php _e('Are you sure to check the database? This will take some time.\n\nClick [Cancel] to stop, [OK] to continue.', $domain);?>')" />
<input type="submit" name="do-fix-database" class="button-primary" value="<?php _e('Fix database', $domain);?>" onclick="return confirm('<?php _e('Are you sure to do fix the database? This will take some time.\n\nClick [Cancel] to stop, [OK] to continue.', $domain);?>')" />
</form>
<?php if (defined('WP_DEBUG') && WP_DEBUG == true) : ?>
<h3><?php _e('Columns Information', $domain);?></h3>
<p>
<?php _e('Select a table name and click "Display Columns" button, and you\'ll see the column property of that table. This information is for debug use.', $domain);?>
@ -456,6 +458,8 @@ class DatabaseMaintenance {
</select>
<input type="submit" name="show-columns" class="button-secondary" value="<?php _e('Display Columns', $domain);?>" onclick="return confirm('<?php _e('Display columns in the selected table.\n\nClick [Cancel] to stop, [OK] to continue.', $domain);?>')" />
</form>
<?php endif; ?>
</div>
<?php endif;

View File

@ -177,6 +177,18 @@
"class":"compatible"
},
{
"name":"Mathjax Latex",
"compat":"Checked",
"class":"compatible"
},
{
"name":"MP6",
"compat":"Checked",
"class":"compatible"
},
{
"name":"NewStatPress",
"compat":"Needs Patch",
@ -274,7 +286,7 @@
{
"name":"Wordpress Popular Posts",
"compat":"Needs patch",
"compat":"Needs Patch",
"patch_url":"http://dogwood.skr.jp/wordpress/plugins/",
"reason":"MySQL specific query",
"class":"workaround"