aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-22 19:47:49 +0200
committerMax Kostikov <max@kostikov.co>2019-04-22 19:47:49 +0200
commitf0edfca75c6b581dc4d6fed8dac911ef26fa3d4a (patch)
tree59e8a482be9aa536c3f665fa9934f54eb3252e30
parenta6a17a85f32733a29c8d4242e93f1de054d4e6fb (diff)
parent9a6531e2a278f7462241ddde7b3e5363d13b5e58 (diff)
downloadvolse-hubzilla-f0edfca75c6b581dc4d6fed8dac911ef26fa3d4a.tar.gz
volse-hubzilla-f0edfca75c6b581dc4d6fed8dac911ef26fa3d4a.tar.bz2
volse-hubzilla-f0edfca75c6b581dc4d6fed8dac911ef26fa3d4a.zip
Merge branch 'fix-infinite-loop' into 'dev'
Fix infinite loop using postgres as backend See merge request hubzilla/core!1605
-rwxr-xr-xinclude/dba/dba_pdo.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index a70e4a1d7..0279342ec 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -161,23 +161,17 @@ class dba_pdo extends dba_driver {
}
function unescapebin($str) {
- if($this->driver_dbtype === 'pgsql' && (! is_null($str))) {
- $x = '';
- while(! feof($str)) {
- $x .= fread($str,8192);
+ if($this->driver_dbtype === 'pgsql') {
+ if(gettype($str) === 'resource') {
+ $str = stream_get_contents($str);
}
- if(substr($x,0,2) === '\\x') {
- $x = hex2bin(substr($x,2));
+ if(substr($str,0,2) === '\\x') {
+ $str = hex2bin(substr($str,2));
}
- return $x;
-
- }
- else {
- return $str;
}
+ return $str;
}
-
function getdriver() {
return 'pdo';
}