Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-08-28 15:30:33 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-08-31 16:09:40 +0300
commit7ada6e5ab011f142dfb2bb4312dd3bd1128981da (patch)
treec5a89b2f8faf00c1b3190aae37b7d2effc81c852 /lib
parent4ef423913dbfb514d17b54bab69460427d88799a (diff)
Fix writing BLOBs to postgres with recent contacts interaction
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/public/AppFramework/Db/Entity.php7
-rw-r--r--lib/public/AppFramework/Db/QBMapper.php2
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php
index 954b8787c4c..34719c82aea 100644
--- a/lib/public/AppFramework/Db/Entity.php
+++ b/lib/public/AppFramework/Db/Entity.php
@@ -110,7 +110,12 @@ abstract class Entity {
// if type definition exists, cast to correct type
if ($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
- settype($args[0], $this->_fieldTypes[$name]);
+ $type = $this->_fieldTypes[$name];
+ if ($type === 'blob') {
+ // (B)LOB is treated as string when we read from the DB
+ $type = 'string';
+ }
+ settype($args[0], $type);
}
$this->$name = $args[0];
} else {
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php
index 9b396965706..ebbe92e7875 100644
--- a/lib/public/AppFramework/Db/QBMapper.php
+++ b/lib/public/AppFramework/Db/QBMapper.php
@@ -230,6 +230,8 @@ abstract class QBMapper {
case 'bool':
case 'boolean':
return IQueryBuilder::PARAM_BOOL;
+ case 'blob':
+ return IQueryBuilder::PARAM_LOB;
}
return IQueryBuilder::PARAM_STR;