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/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-11-13 21:15:31 +0300
committerGitHub <noreply@github.com>2020-11-13 21:15:31 +0300
commitcd270d49c0782a7fbe2d63cb574654d1c1511461 (patch)
treeea7b0cfa7bd46a05ff8dcc2c9c678f752919a81c /apps
parentfd76bf18eabc57812311d19fe224d967537ada38 (diff)
parentcb5bb693ded2c6c003d2cfb5e89c336a27c6f1fe (diff)
Merge pull request #24096 from nextcloud/fix/contacts-interaction-card-resource-to-string
Convert the card resource to a string if necessary
Diffstat (limited to 'apps')
-rw-r--r--apps/contactsinteraction/lib/Db/CardSearchDao.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/contactsinteraction/lib/Db/CardSearchDao.php b/apps/contactsinteraction/lib/Db/CardSearchDao.php
index 391dca60fab..0636829272b 100644
--- a/apps/contactsinteraction/lib/Db/CardSearchDao.php
+++ b/apps/contactsinteraction/lib/Db/CardSearchDao.php
@@ -28,6 +28,8 @@ namespace OCA\ContactsInteraction\Db;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IUser;
+use function is_resource;
+use function stream_get_contents;
class CardSearchDao {
@@ -79,12 +81,15 @@ class CardSearchDao {
->andWhere($cardQuery->expr()->in('addressbookid', $cardQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
->setMaxResults(1);
$result = $cardQuery->execute();
- /** @var string|false $card */
+ /** @var string|resource|false $card */
$card = $result->fetchColumn(0);
if ($card === false) {
return null;
}
+ if (is_resource($card)) {
+ return stream_get_contents($card);
+ }
return $card;
}