Fix : Test pg_escape and pg_unescape exist before executing them
This commit is contained in:
@@ -132,7 +132,12 @@ class DbHelper
|
||||
public function getExtra($data)
|
||||
{
|
||||
if ($this->getDBType() == "pgsql" && is_resource($data)) {
|
||||
if (function_exists("pg_unescape_bytea")) {
|
||||
$extra = pg_unescape_bytea(stream_get_contents($data));
|
||||
}
|
||||
else {
|
||||
$extra = stream_get_contents($data);
|
||||
}
|
||||
return unserialize($extra);
|
||||
}
|
||||
return unserialize($data);
|
||||
|
||||
@@ -65,8 +65,10 @@ class YoutubeHelper
|
||||
if ($file) {
|
||||
$extra = serialize($extra);
|
||||
if($this->dbconn->getDBType() == "pgsql"){
|
||||
if (function_exists("pg_escape_bytea")) {
|
||||
$extra = pg_escape_bytea($extra);
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'uid' => $this->user,
|
||||
'gid' => $this->gid,
|
||||
|
||||
Reference in New Issue
Block a user