summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-15 12:14:17 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-15 12:14:17 +0100
commite9eeb3607fe0ba15413c1c22b1120fc53aaed6dc (patch)
tree1da9445e8bc8bb499cf7c7639629dbf612d9b5cd /apps/dav
parentf8180579d03fcd10ab8f92f1ecb27899436c7653 (diff)
parent6b4117df34232fbe9da49fca9a813bc8c5ec226d (diff)
downloadnextcloud-server-e9eeb3607fe0ba15413c1c22b1120fc53aaed6dc.tar.gz
nextcloud-server-e9eeb3607fe0ba15413c1c22b1120fc53aaed6dc.zip
Merge pull request #23074 from owncloud/issue-22835-correctly-use-querybuilder-api
Correctly escape join statements and use selectAlias
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/caldav/caldavbackend.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php
index fdfc8c399ed..bb50100d9a2 100644
--- a/apps/dav/lib/caldav/caldavbackend.php
+++ b/apps/dav/lib/caldav/caldavbackend.php
@@ -815,9 +815,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
function getCalendarObjectByUID($principalUri, $uid) {
$query = $this->db->getQueryBuilder();
- $query->select([$query->createFunction('c.`uri` AS `calendaruri`'), $query->createFunction('co.`uri` AS `objecturi`')])
+ $query->selectAlias('c.uri', 'calendaruri')->selectAlias('co.uri', 'objecturi')
->from('calendarobjects', 'co')
- ->leftJoin('co', 'calendars', 'c', 'co.`calendarid` = c.`id`')
+ ->leftJoin('co', 'calendars', 'c', $query->expr()->eq('co.calendarid', 'c.id'))
->where($query->expr()->eq('c.principaluri', $query->createNamedParameter($principalUri)))
->andWhere($query->expr()->eq('co.uid', $query->createNamedParameter($uid)));