add error message detailing what is wrong if bagostuff fails... ;-)
[lhc/web/wiklou.git] / includes / BagOStuff.php
index 78ca511..662e32c 100644 (file)
@@ -359,7 +359,7 @@ class SqlBagOStuff extends BagOStuff {
         * @param string $serial
         * @return mixed
         */
-       function &_unserialize( $serial ) {
+       function _unserialize( $serial ) {
                if( function_exists( 'gzinflate' ) ) {
                        $decomp = @gzinflate( $serial );
                        if( false !== $decomp ) {
@@ -406,6 +406,10 @@ class MediaWikiBagOStuff extends SqlBagOStuff {
        function getTableName() {
                if ( !$this->tableInitialised ) {
                        $dbw =& wfGetDB( DB_MASTER );
+                       /* This is actually a hack, we should be able 
+                          to use Language classes here... or not */
+                       if (!$dbw)
+                               die("Could not connect to database");
                        $this->table = $dbw->tableName( $this->table );
                        $this->tableInitialised = true;
                }