From 39f0707201109d7d5784e254aca320af43812ec8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 23 Oct 2016 17:53:34 -0700 Subject: fetch bytea as stream --- include/dba/dba_pdo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/dba') diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php index 8ba0adb99..9f8deaf17 100755 --- a/include/dba/dba_pdo.php +++ b/include/dba/dba_pdo.php @@ -137,8 +137,9 @@ class dba_pdo extends dba_driver { // The initial backslash inserted by escapebin above will have been stripped // by the postgres server, leaving us with '\x{hexdigits}' + // The PDO driver returns bytea fields as streams, so fetch the content with fgets - return hex2bin(substr($str,2)); + return hex2bin(substr(fgets($str),2)); } else { return $str; -- cgit v1.2.3