From fe1f9a5224f80cd727d55cbd09963564aeaeb6ee Mon Sep 17 00:00:00 2001 From: kjmtsh Date: Fri, 2 Aug 2013 20:25:51 +0000 Subject: [PATCH] tagging version 1.2.1 git-svn-id: https://plugins.svn.wordpress.org/sqlite-integration/tags/1.2.1@750264 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- db.php | 1 - functions-5-2.php | 1 - functions.php | 1 - install.php | 1 - languages/sqlite-integration-ja.mo | Bin 43052 -> 43196 bytes languages/sqlite-integration-ja.po | 8 +++---- languages/sqlite-integration.pot | 4 ++-- pdodb.class.php | 16 +++++++++----- pdoengine.class.php | 1 - query.class.php | 24 ++++++++++++--------- query_alter.class.php | 1 - query_create.class.php | 1 - readme-ja.txt | 33 +++++++++++++++++++---------- readme.txt | 26 ++++++++++++++++------- schema.php | 1 - sqlite-integration.php | 2 +- utilities/documentation.php | 5 ++--- utilities/patch.php | 30 ++++++++++++++------------ utilities/plugin_lists.json | 12 +++++++++++ utilities/utility.php | 2 +- 20 files changed, 104 insertions(+), 66 deletions(-) diff --git a/db.php b/db.php index 3724300..d2d92a5 100644 --- a/db.php +++ b/db.php @@ -5,7 +5,6 @@ * wordpress/wp-content/db.php * * @package SQLite Integration - * @version 1.1 * @author Kojima Toshiyasu, Justin Adie * */ diff --git a/functions-5-2.php b/functions-5-2.php index 6867473..62a8be3 100644 --- a/functions-5-2.php +++ b/functions-5-2.php @@ -1,7 +1,6 @@ zh0s-vqYaDI7OQH?q!KB*;VLo}Zo-84w_nK|K(6QI`aYtU}xKBCByX@(~GqL8JqA z#}aA zqF$f^+hL7WpF!==Wo(PLF%rMRKG>?0zTY7dL!&DvhNBIqA$^fG=)=gjp^juvXXA&c z7dnMK@e=9<{)r4u9^!ax-9=;&reP>LF#`8vZ*0KsTwi{s(HH&cMSC2M`i05J?8+3> z4lF>uzzWOF=ucgV%joDye2F?d#LV1m)Fs`Hdf|_d)sx$(9rzv{%(D2?y#W}BJvLEUj<4~tO37fcZ2C^y=%|hzTB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XwOM_ny`2MKeJkfSQ0~a6BTXJmq;U$r|b8nGM1=B5pALxH7LVK zD^f&`lM1qjTqY`e$rJvXd&%bw@9^4{aFh6p?hKVBB*9;EFSFqcDIg2TbaH|8ApWBH-%fNdtK^Ve zRVZi46!JVNBv;8OqWk#QL}jPL|Ce$*>ibDE@7M>ZXG$N!^UD831$$91lsUv#?62~t z5WY>4$Vl=SIZT4d8$=!LM$$Rqq=ZBem2u=eSwT9Ga-BAX zib_ASi%eF7a)p$V57qF>TX>NqlP+Wfd6G0I^T}HBpu9q5Bk4uryn};1D?KyR%{4S8 zko9CAX-Ec<5OR*JBvzdmniUwFUQkk!S6EPz8r`9!dQa4z_(ysr^@z@!l^@+RDLHy- z!Mwcc0RztlRCgLaA^g>>oW$xYImO8>`Apr4^1794>sD0rxw^8~>dMa4tvpwqvh`?S Kb=>aC!2bggOgno3 diff --git a/languages/sqlite-integration-ja.po b/languages/sqlite-integration-ja.po index 2c6c093..a32223f 100644 --- a/languages/sqlite-integration-ja.po +++ b/languages/sqlite-integration-ja.po @@ -211,12 +211,12 @@ msgid "" "SQLite for its database. But PDO for WordPress doesn't seem to be maintained " "any more only to be outdated. SQLite Integration makes use of the basic ideas " "and framework of PDO for WordPress, adds some new features and updates it to " -"be able to work with the newest version of WordPress(3.5.1 and 3.6 beta)." +"be able to work with the newest version of WordPress(3.6)." msgstr "" "このプラグインは" "PDO for WordPressの後継です。PDO for WordPressはWordPressでSQLiteを使えるようにする" "ものでしたが、もうメンテナンスされていないようで、古くなってしまいました。SQLite Integrationは、その基本的な" -"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.5.1および3.6ベータ)で動作するように" +"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.6)で動作するように" "したものです。" #: utilities/documentation.php:44 @@ -589,8 +589,8 @@ msgstr "パッチを適用しました。" #: utilities/patch.php:94 utilities/patch.php:121 #, php-format -msgid "Error! Messages: %s" -msgstr "エラー。メッセージは: %s" +msgid "Error! File %s is not deleted." +msgstr "エラー。ファイル%sは削除できませんでした。" #: utilities/patch.php:118 msgid "Error!: patches directory is not accessible." diff --git a/languages/sqlite-integration.pot b/languages/sqlite-integration.pot index c736014..9e3ce52 100644 --- a/languages/sqlite-integration.pot +++ b/languages/sqlite-integration.pot @@ -195,7 +195,7 @@ msgid "" "SQLite for its database. But PDO for WordPress doesn't seem to be maintained " "any more only to be outdated. SQLite Integration makes use of the basic ideas " "and framework of PDO for WordPress, adds some new features and updates it to " -"be able to work with the newest version of WordPress(3.5.1 and 3.6 beta)." +"be able to work with the newest version of WordPress(3.6)." msgstr "" #: utilities/documentation.php:44 @@ -505,7 +505,7 @@ msgstr "" #: utilities/patch.php:94 utilities/patch.php:121 #, php-format -msgid "Error! Messages: %s" +msgid "Error! File %s is not deleted." msgstr "" #: utilities/patch.php:118 diff --git a/pdodb.class.php b/pdodb.class.php index 7f0816f..db927a9 100644 --- a/pdodb.class.php +++ b/pdodb.class.php @@ -1,7 +1,6 @@ charset; + if ( ! isset( $collate ) ) + $collate = $this->collate; + } /** * dummy out the MySQL function * @see wpdb::select() @@ -62,10 +71,7 @@ class PDODB extends wpdb { * @see wpdb::_real_escape() */ function _real_escape($string) { - if ($this->dbh && $this->real_escape) - return $this->dbh->quote($string); - else - return addslashes($string); + return addslashes($string); } /** diff --git a/pdoengine.class.php b/pdoengine.class.php index 6064e2f..03f7183 100644 --- a/pdoengine.class.php +++ b/pdoengine.class.php @@ -1,7 +1,6 @@ _delete_index_hints(); $this->_rewrite_regexp(); $this->_rewrite_boolean(); + $this->_fix_date_quoting(); break; case 'insert': $this->_strip_backticks(); $this->_execute_duplicate_key_update(); $this->_rewrite_insert_ignore(); $this->_rewrite_regexp(); + $this->_fix_date_quoting(); break; case 'update': $this->_strip_backticks(); @@ -290,20 +291,23 @@ class PDOSQLiteDriver { } /** - * Justin Adie says: - * method to fix inconsistent use of quoted, unquoted etc date values in query function - * this is ironic, given the above rewrite badlyformed dates method - * examples + * Fix the date string and quote. This is required for the calendar widget. + * * where month(fieldname)=08 becomes month(fieldname)='8' * where month(fieldname)='08' becomes month(fieldname)='8' * - * I don't understand... + * I use preg_replace_callback instead of 'e' option because of security reason. + * cf. PHP manual (regular expression) * * @return void */ - private function _fix_date_quoting(){ - $pattern = '/(month|year|second|day|minute|hour|dayofmonth)\s*\((.*?)\)\s*=\s*["\']?(\d{1,4})[\'"]?\s*/ei'; - $this->_query = preg_replace($pattern, "'\\1(\\2)=\'' . intval('\\3') . '\' ' ", $this->_query); + private function _fix_date_quoting() { + $pattern = '/(month|year|second|day|minute|hour|dayofmonth)\\s*\((.*?)\)\\s*=\\s*["\']?(\d{1,4})[\'"]?\\s*/im'; + $this->_query = preg_replace_callback($pattern, array($this, '__fix_date_quoting'), $this->_query); + } + private function __fix_date_quoting($match) { + $fixed_val = "{$match[1]}({$match[2]})='" . intval($match[3]) . "' "; + return $fixed_val; } private function _rewrite_regexp(){ @@ -408,7 +412,7 @@ class PDOSQLiteDriver { return; } // data check - if (preg_match('/^\((.*)\)\\s*VALUES\\s*\((.*)\)$/im', $insert_data, $match_1)) { + if (preg_match('/^\((.*)\)\\s*VALUES\\s*\((.*)\)$/ims', $insert_data, $match_1)) { $col_array = explode(',', $match_1[1]); $ins_data_array = explode(',', $match_1[2]); foreach ($col_array as $col) { diff --git a/query_alter.class.php b/query_alter.class.php index 5061546..cd0f814 100644 --- a/query_alter.class.php +++ b/query_alter.class.php @@ -3,7 +3,6 @@ * The class for manipulating ALTER query * newly supports multiple variants * @package SQLite Integration - * @version 1.1 * @author Kojima Toshiyasu */ class AlterQuery { diff --git a/query_create.class.php b/query_create.class.php index 6e41e2c..c2c7bd7 100644 --- a/query_create.class.php +++ b/query_create.class.php @@ -1,7 +1,6 @@

- PDO for WordPress, which enabled WordPress to use SQLite for its database. But PDO for WordPress doesn\'t seem to be maintained any more only to be outdated. SQLite Integration makes use of the basic ideas and framework of PDO for WordPress, adds some new features and updates it to be able to work with the newest version of WordPress(3.5.1 and 3.6 beta).', $domain); ?> + PDO for WordPress, which enabled WordPress to use SQLite for its database. But PDO for WordPress doesn\'t seem to be maintained any more only to be outdated. SQLite Integration makes use of the basic ideas and framework of PDO for WordPress, adds some new features and updates it to be able to work with the newest version of WordPress(3.6).', $domain); ?>

SQLite Web Page says — SQLite is a "software library that implements selfcontained, serverless, zero-configuration, transactional SQL database engine". It is "a good choice for small to medium size websites". It\'s small and portable, and you don\'t need any database server system.', $domain); ?> diff --git a/utilities/patch.php b/utilities/patch.php index d359289..40c2159 100644 --- a/utilities/patch.php +++ b/utilities/patch.php @@ -3,7 +3,7 @@ * This file contains PatchUtils class * * @package SQLite Integration - * @since 1.1 + * @author Kojima Toshiyasu * */ class PatchUtils { @@ -34,6 +34,8 @@ class PatchUtils { * @return boolean|array */ private function apply_patches() { + global $utils; + $domain = $utils->text_domain; $installed_plugins = array(); $file_names = array(); $output = array(); @@ -103,6 +105,8 @@ class PatchUtils { * @return boolean|array */ private function delete_patch_files() { + global $utils; + $domain = $utils->text_domain; $file_names = array(); $rm_results = array(); if (isset($_POST['plugin_checked'])) { @@ -110,18 +114,16 @@ class PatchUtils { } else { return false; } - $command = 'rm -f'; - foreach ($file_names as $file) { - if (chdir(SQLitePatchDir)) { - exec("$command $file", $output, $retval); - } else { - $rm_results[$file] = __('Error!: patches directory is not accessible.', $domain); - } - if ($retval > 0) { - $rm_results[$file] = sprintf(__('Error! Messages: %s', $domain), $output); - } else { - $rm_results[$file] = sprintf(__('File %s is deleted.', $domain), $file); - } + if (chdir(SQLitePatchDir)) { + foreach ($file_names as $file) { + if (unlink($file)) { + $rm_results[$file] = sprintf(__('File %s is deleted.', $domain), $file); + } else { + $rm_results[$file] = sprintf(__('Error! File %s is not deleted.', $domain), $file); + } + } + } else { + $rm_results[$file] = __('Error!: patches directory is not accessible.', $domain); } return $rm_results; } @@ -130,6 +132,8 @@ class PatchUtils { * No return values. */ private function upload_file() { + global $utils; + $domain = $utils->text_domain; if (!file_exists(SQLitePatchDir) || !is_dir(SQLitePatchDir)) { mkdir(SQLitePatchDir, 0705, true); } diff --git a/utilities/plugin_lists.json b/utilities/plugin_lists.json index 5055e89..b65f1ec 100644 --- a/utilities/plugin_lists.json +++ b/utilities/plugin_lists.json @@ -111,6 +111,12 @@ "class":"compatible" }, + { + "name":"FeedWordPress", + "compat":"Checked", + "class":"compatible" + }, + { "name":"Google Analyticator", "compat":"Checked", @@ -247,6 +253,12 @@ "class":"compatible" }, + { + "name":"WP Emmet", + "compat":"Checked", + "class":"compatible" + }, + { "name":"WP Multibyte Patch", "compat":"Checked", diff --git a/utilities/utility.php b/utilities/utility.php index a122b2d..14ed133 100644 --- a/utilities/utility.php +++ b/utilities/utility.php @@ -2,7 +2,7 @@ /** * * @package SQLite Integration - * @author kjm + * @author Kojima Toshiyasu * */ class SQLiteIntegrationUtils {