ネット集客なら『やさしす』に!

Web集客屋 やさしす

ネット集客なら『やさしす』に! header image 4

wordpress+SQLite

PDO (SQLite) For WordPress] 2.7.0 ページの編集でエラーが出る時の対応

2010年03月15日 · コメント(0) · wordpress+SQLite

http://wordpress.org/support/topic/361670#post-1385307
To add or edit page, I have got a Warning hereunder.

Warning: implode() [function.implode]: Invalid arguments passed in /wordpress/wp-includes/post.php on line 1980

I have tried to fix with this patch.
Almost copy and paste from the wpdb::escape().
Is this right or are there any better way to fix?

Index: /wordpress/wp-content/pdo/db.php
===================================================================
— /wordpress/wp-content/pdo/db.php (revision 508)
+++ /wordpress/wp-content/pdo/db.php (working copy)
@@ -113,8 +113,18 @@
* @param $string string the variable to be escaped
* @return string escaped variable
*/
- function escape($string) {
- return addslashes($string);
+ function escape($data) {
+ if ( is_array($data) ) {
+ foreach ( (array) $data as $k => $v ) {
+ if ( is_array($v) )
+ $data[$k] = $this->escape( $v );
+ else
+ $data[$k] = addslashes( $v );
+ }
+ } else {
+ $data = addslashes( $data );
+ }
+ return $data;
}

/**

Note that.
The wordpress try to escape an Array like this at wp-admin/page.php.

array(1) { [0]=> string(4) “page” }

http://wordpress.org/extend/plugins/pdo-for-wordpress/

[続きを読む →]

タグ :