Merge branch 'fix-infinite-loop' into 'dev'

Fix infinite loop using postgres as backend

See merge request hubzilla/core!1605
This commit is contained in:
Max Kostikov 2019-04-22 19:47:49 +02:00
commit f0edfca75c

View File

@ -161,23 +161,17 @@ class dba_pdo extends dba_driver {
} }
function unescapebin($str) { function unescapebin($str) {
if($this->driver_dbtype === 'pgsql' && (! is_null($str))) { if($this->driver_dbtype === 'pgsql') {
$x = ''; if(gettype($str) === 'resource') {
while(! feof($str)) { $str = stream_get_contents($str);
$x .= fread($str,8192);
} }
if(substr($x,0,2) === '\\x') { if(substr($str,0,2) === '\\x') {
$x = hex2bin(substr($x,2)); $str = hex2bin(substr($str,2));
} }
return $x;
}
else {
return $str;
} }
return $str;
} }
function getdriver() { function getdriver() {
return 'pdo'; return 'pdo';
} }