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)
|
public function getExtra($data)
|
||||||
{
|
{
|
||||||
if ($this->getDBType() == "pgsql" && is_resource($data)) {
|
if ($this->getDBType() == "pgsql" && is_resource($data)) {
|
||||||
$extra = pg_unescape_bytea(stream_get_contents($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($extra);
|
||||||
}
|
}
|
||||||
return unserialize($data);
|
return unserialize($data);
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ class YoutubeHelper
|
|||||||
if ($file) {
|
if ($file) {
|
||||||
$extra = serialize($extra);
|
$extra = serialize($extra);
|
||||||
if($this->dbconn->getDBType() == "pgsql"){
|
if($this->dbconn->getDBType() == "pgsql"){
|
||||||
$extra = pg_escape_bytea($extra);
|
if (function_exists("pg_escape_bytea")) {
|
||||||
|
$extra = pg_escape_bytea($extra);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'uid' => $this->user,
|
'uid' => $this->user,
|
||||||
|
|||||||
Reference in New Issue
Block a user