From: Tim Starling Date: Sat, 6 Sep 2008 13:56:59 +0000 (+0000) Subject: Implemented blob support for SQLite. Allows null characters to be inserted into the... X-Git-Tag: 1.31.0-rc.0~45440 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22sites_tous%22%29%20.%20%22?a=commitdiff_plain;h=f5c8dd247430503554bf3cfcf02ca30ed5a274c1;p=lhc%2Fweb%2Fwiklou.git Implemented blob support for SQLite. Allows null characters to be inserted into the database. Avoids total breakage of the objectcache table. For trunk and 1.13. --- diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index c6f9bc0f21..4ba0f1f1dc 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -289,15 +289,22 @@ class DatabaseSqlite extends Database { } function encodeBlob($b) { - return $this->strencode($b); + return new Blob( $b ); } function decodeBlob($b) { + if ($b instanceof Blob) { + $b = $b->fetch(); + } return $b; } function addQuotes($s) { - return $this->mConn->quote($s); + if ( $s instanceof Blob ) { + return "x'" . bin2hex( $s->fetch() ) . "'"; + } else { + return $this->mConn->quote($s); + } } function quote_ident($s) { return $s; }