From: Michael M Slusarz Date: Fri, 28 Jan 2011 20:13:03 +0000 (-0700) Subject: Another place to fix BYTEA conversion X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=855d92a58b928fa371570011a3906ee28b573316;p=horde.git Another place to fix BYTEA conversion --- diff --git a/turba/lib/Driver/Sql.php b/turba/lib/Driver/Sql.php index 380308210..79c1e0e27 100644 --- a/turba/lib/Driver/Sql.php +++ b/turba/lib/Driver/Sql.php @@ -154,8 +154,12 @@ class Turba_Driver_Sql extends Turba_Driver if (isset($blobFields[$field])) { switch ($this->_db->adapterName()) { case 'PDO_PostgreSQL': - $entry[$field] = pack('H' . strlen($val), $val); - break; + if (is_resource($val)) { + $tmp = stream_get_contents($val); + fclose($val); + $val = $tmp; + } + // Fall-through default: $entry[$field] = $val;