Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature-zimbraldap
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Perschon <tobias@perschon.at>

# Conflicts:
#	3rdparty
  • Loading branch information
tofuSCHNITZEL committed Jun 16, 2020
2 parents 8045e7e + 4cff3a3 commit 98888bc
Show file tree
Hide file tree
Showing 242 changed files with 1,295 additions and 834 deletions.
3 changes: 3 additions & 0 deletions apps/accessibility/l10n/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ OC.L10N.register(
"accessibility",
{
"Dark theme" : "Dökkt þema",
"Enable dark theme" : "Virkja dökkt þema",
"A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find." : "Dökkt þema til að minnka álag á augun meðal annars með því að minnka heildarljósmagn og birtustig. Þetta er enn í þróun þannig að gott væri ef þú tilkynntir alla galla sem þú rekst á.",
"High contrast mode" : "Mikil birtuskil",
"Enable high contrast mode" : "Virkja ham með mikil birtuskil",
"A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased." : "Þema með mikil birtuskil til að auðvelda vafur. Sjónræn gæði minnka en skýrleiki eykst",
"Dyslexia font" : "Dyslexia letur",
"Enable dyslexia font" : "Virkja letur fyrir lesblinda",
"OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia." : "OpenDyslexic eru frjálsar leturgerðir sem eru hannaðar til að ráða bug á eða minnka vægi ýmissa villna sem stafa af lesblindu (dyslexia).",
"Accessibility" : "Aukið aðgengi",
"Accessibility options for nextcloud" : "Valkostir fyrir auðveldað aðgengi í Nextcloud",
Expand Down
3 changes: 3 additions & 0 deletions apps/accessibility/l10n/is.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{ "translations": {
"Dark theme" : "Dökkt þema",
"Enable dark theme" : "Virkja dökkt þema",
"A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find." : "Dökkt þema til að minnka álag á augun meðal annars með því að minnka heildarljósmagn og birtustig. Þetta er enn í þróun þannig að gott væri ef þú tilkynntir alla galla sem þú rekst á.",
"High contrast mode" : "Mikil birtuskil",
"Enable high contrast mode" : "Virkja ham með mikil birtuskil",
"A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased." : "Þema með mikil birtuskil til að auðvelda vafur. Sjónræn gæði minnka en skýrleiki eykst",
"Dyslexia font" : "Dyslexia letur",
"Enable dyslexia font" : "Virkja letur fyrir lesblinda",
"OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia." : "OpenDyslexic eru frjálsar leturgerðir sem eru hannaðar til að ráða bug á eða minnka vægi ýmissa villna sem stafa af lesblindu (dyslexia).",
"Accessibility" : "Aukið aðgengi",
"Accessibility options for nextcloud" : "Valkostir fyrir auðveldað aðgengi í Nextcloud",
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/l10n/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ OC.L10N.register(
"Decline" : "拒否",
"More options …" : "他のオプション …",
"More options at %s" : "%s のその他のオプション",
"Contacts" : "アドレス帳",
"Contacts" : "連絡先",
"Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "iOS / macOSでCalDAVおよびCardDAVを使用するには、%sにHTTPSを設定する必要があります。",
"Configures a CalDAV account" : "CalDAVアカウントを設定します",
"Configures a CardDAV account" : "CardDAVアカウントを設定します",
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/l10n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"Decline" : "拒否",
"More options …" : "他のオプション …",
"More options at %s" : "%s のその他のオプション",
"Contacts" : "アドレス帳",
"Contacts" : "連絡先",
"Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "iOS / macOSでCalDAVおよびCardDAVを使用するには、%sにHTTPSを設定する必要があります。",
"Configures a CalDAV account" : "CalDAVアカウントを設定します",
"Configures a CardDAV account" : "CardDAVアカウントを設定します",
Expand Down
44 changes: 27 additions & 17 deletions apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,39 +944,49 @@ public function updateShares(IShareable $shareable, $add, $remove) {
* @param array $searchProperties defines the properties within the query pattern should match
* @param array $options = array() to define the search behavior
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* - 'limit' - Set a numeric limit for the search results
* - 'offset' - Set the offset for the limited search results
* @return array an array of contacts which are arrays of key-value-pairs
*/
public function search($addressBookId, $pattern, $searchProperties, $options = []) {
$query = $this->db->getQueryBuilder();
$query2 = $this->db->getQueryBuilder();

$query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
$query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
$query2->selectDistinct('cp.cardid')
->from($this->dbCardsPropertiesTable, 'cp')
->andWhere($query2->expr()->eq('cp.addressbookid', $query2->createNamedParameter($addressBookId)));
$or = $query2->expr()->orX();
foreach ($searchProperties as $property) {
$or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
$or->add($query2->expr()->eq('cp.name', $query2->createNamedParameter($property)));
}
$query2->andWhere($or);

// No need for like when the pattern is empty
if ('' !== $pattern) {
if (\array_key_exists('escape_like_param', $options) && $options['escape_like_param'] === false) {
$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter($pattern)));
$query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter($pattern)));
} else {
$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
$query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
}
}
// // FIXME Broken on MySQL: SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
// // FIXME Should use 2 queries instead
// if (isset($options['limit'])) {
// $query2->setMaxResults($options['limit']);
// }
// if (isset($options['offset'])) {
// $query2->setFirstResult($options['offset']);
// }

$query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));

if (isset($options['limit'])) {
$query2->setMaxResults($options['limit']);
}
if (isset($options['offset'])) {
$query2->setFirstResult($options['offset']);
}

$result = $query2->execute();
$matches = $result->fetchAll();
$result->closeCursor();
$matches = array_map(function ($match) {
return (int) $match['cardid'];
}, $matches);

$query = $this->db->getQueryBuilder();
$query->select('c.carddata', 'c.uri')
->from($this->dbCardsTable, 'c')
->where($query->expr()->in('c.id', $query->createNamedParameter($matches, IQueryBuilder::PARAM_INT_ARRAY)));

$result = $query->execute();
$cards = $result->fetchAll();
Expand Down
2 changes: 2 additions & 0 deletions apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ public function dataTestSearch() {
['Do', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]],
'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]],
'case insensitive' => ['john', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]],
'limit' => ['john', ['FN'], ['limit' => 1], [['uri0', 'John Doe']]],
'limit and offset' => ['john', ['FN'], ['limit' => 1, 'offset' => 1], [['uri1', 'John M. Doe']]],
'find "_" escaped' => ['_', ['CLOUD'], [], [['uri2', 'find without options']]],
'find not empty ClOUD' => ['%_%', ['CLOUD'], ['escape_like_param'=>false], [['uri0', 'John Doe'], ['uri2', 'find without options']]],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@

class ExceptionPlugin extends \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin {
/**
* @var \Exception[]
* @var \Throwable[]
*/
protected $exceptions = [];

public function logException(\Exception $ex) {
public function logException(\Throwable $ex) {
$exceptionClass = get_class($ex);
if (!isset($this->nonFatalExceptions[$exceptionClass])) {
$this->exceptions[] = $ex;
}
}

/**
* @return \Exception[]
* @return \Throwable[]
*/
public function getExceptions() {
return $this->exceptions;
Expand Down
18 changes: 9 additions & 9 deletions apps/encryption/l10n/el.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 98888bc

Please sign in to comment.