From: Greg Sabino Mullane Date: Wed, 5 Jul 2006 03:56:48 +0000 (+0000) Subject: Add decodeBlob() function to complement encodeBlob() X-Git-Tag: 1.31.0-rc.0~56408 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=a24ce453a08452531d009d1908553b2453c2e309;p=lhc%2Fweb%2Fwiklou.git Add decodeBlob() function to complement encodeBlob() --- diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 7585088edd..182756ab93 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -231,7 +231,7 @@ abstract class SqlBagOStuff extends BagOStuff { } if($row=$this->_fetchobject($res)) { $this->_debug("get: retrieved data; exp time is " . $row->exptime); - return $this->_unserialize($row->value); + return $this->_unserialize($this->_blobdecode($row->value)); } else { $this->_debug('get: no matching rows'); } @@ -291,6 +291,9 @@ abstract class SqlBagOStuff extends BagOStuff { function _blobencode($str) { return $str; } + function _blobdecode($str) { + return $str; + } abstract function _doinsert($table, $vals); abstract function _doquery($sql); @@ -408,6 +411,10 @@ class MediaWikiBagOStuff extends SqlBagOStuff { $dbw =& wfGetDB( DB_MASTER ); return $dbw->encodeBlob($s); } + function _blobdecode($s) { + $dbw =& wfGetDB( DB_MASTER ); + return $dbw->decodeBlob($s); + } function getTableName() { if ( !$this->tableInitialised ) { $dbw =& wfGetDB( DB_MASTER ); diff --git a/includes/Database.php b/includes/Database.php index 65ccd58f0b..f8e579b481 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1854,6 +1854,10 @@ class Database { return $b; } + function decodeBlob($b) { + return $b; + } + /** * Read and execute SQL commands from a file. * Returns true on success, error string on failure