summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php7
-rw-r--r--apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php11
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php1
-rw-r--r--lib/private/AppConfig.php8
-rw-r--r--lib/private/Collaboration/Collaborators/MailPlugin.php11
-rw-r--r--lib/private/Repair/Collation.php5
-rw-r--r--lib/private/URLGenerator.php6
-rw-r--r--settings/Controller/AdminSettingsController.php4
-rw-r--r--settings/Controller/CommonSettingsTrait.php5
-rw-r--r--settings/Controller/PersonalSettingsController.php4
11 files changed, 37 insertions, 27 deletions
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 62d218f0a2a..0f6e819bcc5 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -148,10 +148,11 @@ class BirthdayService {
/**
* @param string $cardData
* @param string $dateField
+ * @param string $postfix
* @param string $summarySymbol
* @return null|VCalendar
*/
- public function buildDateFromContact($cardData, $dateField, $summarySymbol) {
+ public function buildDateFromContact($cardData, $dateField, $postfix, $summarySymbol) {
if (empty($cardData)) {
return null;
}
@@ -221,7 +222,7 @@ class BirthdayService {
$date
);
$vEvent->DTEND['VALUE'] = 'DATE';
- $vEvent->{'UID'} = $doc->UID;
+ $vEvent->{'UID'} = $doc->UID . $postfix;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
$vEvent->{'SUMMARY'} = $summary;
$vEvent->{'TRANSP'} = 'TRANSPARENT';
@@ -297,7 +298,7 @@ class BirthdayService {
*/
private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) {
$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
- $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['symbol']);
+ $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix'], $type['symbol']);
$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
if (is_null($calendarData)) {
if (!is_null($existing)) {
diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
index 867168033a4..739b81ddf01 100644
--- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
@@ -64,7 +64,7 @@ class BirthdayServiceTest extends TestCase {
* @param string | null $data
*/
public function testBuildBirthdayFromContact($expectedSummary, $data) {
- $cal = $this->service->buildDateFromContact($data, 'BDAY', '*');
+ $cal = $this->service->buildDateFromContact($data, 'BDAY', '', '*');
if ($expectedSummary === null) {
$this->assertNull($cal);
} else {
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index c8465997f65..cc9cdc08138 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -572,13 +572,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
public function test() {
- $test = $this->getConnection()->getBucketAcl(array(
- 'Bucket' => $this->bucket,
- ));
- if (isset($test) && !is_null($test->getPath('Owner/ID'))) {
- return true;
- }
- return false;
+ $this->getConnection()->headBucket([
+ 'Bucket' => $this->bucket
+ ]);
+ return true;
}
public function getId() {
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index 8bf9ca15349..4dbc360c0c4 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -174,6 +174,7 @@ abstract class Fetcher {
$this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => Util::INFO, 'message' => 'Could not connect to appstore']);
return [];
} catch (\Exception $e) {
+ $this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => Util::INFO]);
return [];
}
}
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index 4e102522550..10dc656e5cb 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -293,9 +293,11 @@ class AppConfig implements IAppConfig {
public function getFilteredValues($app) {
$values = $this->getValues($app, false);
- foreach ($this->sensitiveValues[$app] as $sensitiveKey) {
- if (isset($values[$sensitiveKey])) {
- $values[$sensitiveKey] = IConfig::SENSITIVE_VALUE;
+ if (array_key_exists($app, $this->sensitiveValues)) {
+ foreach ($this->sensitiveValues[$app] as $sensitiveKey) {
+ if (isset($values[$sensitiveKey])) {
+ $values[$sensitiveKey] = IConfig::SENSITIVE_VALUE;
+ }
}
}
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php
index 99629f213e1..464b6702066 100644
--- a/lib/private/Collaboration/Collaborators/MailPlugin.php
+++ b/lib/private/Collaboration/Collaborators/MailPlugin.php
@@ -28,9 +28,11 @@ use OCP\Collaboration\Collaborators\ISearchPlugin;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Collaboration\Collaborators\SearchResultType;
use OCP\Contacts\IManager;
+use OCP\Federation\ICloudId;
use OCP\Federation\ICloudIdManager;
use OCP\IConfig;
use OCP\IGroupManager;
+use OCP\IUser;
use OCP\IUserSession;
use OCP\Share;
@@ -112,7 +114,7 @@ class MailPlugin implements ISearchPlugin {
continue;
}
- if (!$searchResult->hasResult($userType, $cloud->getUser())) {
+ if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$singleResult = [[
'label' => $contact['FN'] . " ($emailAddress)",
'value' => [
@@ -133,7 +135,7 @@ class MailPlugin implements ISearchPlugin {
continue;
}
- if (!$searchResult->hasResult($userType, $cloud->getUser())) {
+ if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$singleResult = [[
'label' => $contact['FN'] . " ($emailAddress)",
'value' => [
@@ -191,4 +193,9 @@ class MailPlugin implements ISearchPlugin {
return true;
}
+
+ public function isCurrentUser(ICloudId $cloud) {
+ $currentUser = $this->userSession->getUser();
+ return $currentUser instanceof IUser ? $currentUser->getUID() === $cloud->getUser() : false;
+ }
}
diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php
index 2642985371b..f2cc9373176 100644
--- a/lib/private/Repair/Collation.php
+++ b/lib/private/Repair/Collation.php
@@ -6,6 +6,7 @@
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Robin Müller <robin.mueller@1und1.de>
*
* @license AGPL-3.0
*
@@ -124,7 +125,7 @@ class Collation implements IRepairStep {
" FROM INFORMATION_SCHEMA . COLUMNS" .
" WHERE TABLE_SCHEMA = ?" .
" AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" .
- " AND TABLE_NAME LIKE \"*PREFIX*%\"",
+ " AND TABLE_NAME LIKE '*PREFIX*%'",
array($dbName)
);
$rows = $statement->fetchAll();
@@ -139,7 +140,7 @@ class Collation implements IRepairStep {
" FROM INFORMATION_SCHEMA . TABLES" .
" WHERE TABLE_SCHEMA = ?" .
" AND TABLE_COLLATION <> '" . $characterSet . "_bin'" .
- " AND TABLE_NAME LIKE \"*PREFIX*%\"",
+ " AND TABLE_NAME LIKE '*PREFIX*%'",
[$dbName]
);
$rows = $statement->fetchAll();
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index f7d80d41b4f..2da86e6d996 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -35,6 +35,7 @@
namespace OC;
+use OCA\Theming\ThemingDefaults;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IRequest;
@@ -170,7 +171,10 @@ class URLGenerator implements IURLGenerator {
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
$themingImagePath = false;
if($themingEnabled) {
- $themingImagePath = \OC::$server->getThemingDefaults()->replaceImagePath($app, $image);
+ $themingDefaults = \OC::$server->getThemingDefaults();
+ if ($themingDefaults instanceof ThemingDefaults) {
+ $themingImagePath = $themingDefaults->replaceImagePath($app, $image);
+ }
}
if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php
index 0114ee73d96..e2ad577024c 100644
--- a/settings/Controller/AdminSettingsController.php
+++ b/settings/Controller/AdminSettingsController.php
@@ -38,9 +38,6 @@ use OCP\Template;
class AdminSettingsController extends Controller {
use CommonSettingsTrait;
- /** @var INavigationManager */
- private $navigationManager;
-
/**
* @param string $appName
* @param IRequest $request
@@ -65,7 +62,6 @@ class AdminSettingsController extends Controller {
* @NoCSRFRequired
*/
public function index($section) {
- $this->navigationManager->setActiveEntry('admin');
return $this->getIndexResponse('admin', $section);
}
diff --git a/settings/Controller/CommonSettingsTrait.php b/settings/Controller/CommonSettingsTrait.php
index 82d675531a8..3d314d9ed53 100644
--- a/settings/Controller/CommonSettingsTrait.php
+++ b/settings/Controller/CommonSettingsTrait.php
@@ -25,6 +25,7 @@
namespace OC\Settings\Controller;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\INavigationManager;
use OCP\Settings\IManager as ISettingsManager;
use OCP\Settings\IIconSection;
use OCP\Settings\ISettings;
@@ -33,6 +34,9 @@ trait CommonSettingsTrait {
/** @var ISettingsManager */
private $settingsManager;
+ /** @var INavigationManager */
+ private $navigationManager;
+
/**
* @param string $currentSection
* @return array
@@ -116,6 +120,7 @@ trait CommonSettingsTrait {
}
private function getIndexResponse($type, $section) {
+ $this->navigationManager->setActiveEntry('settings');
$templateParams = [];
$templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section));
$templateParams = array_merge($templateParams, $this->getSettings($section));
diff --git a/settings/Controller/PersonalSettingsController.php b/settings/Controller/PersonalSettingsController.php
index ad4eb69c32d..9ec7ce72645 100644
--- a/settings/Controller/PersonalSettingsController.php
+++ b/settings/Controller/PersonalSettingsController.php
@@ -34,9 +34,6 @@ use OCP\Template;
class PersonalSettingsController extends Controller {
use CommonSettingsTrait;
- /** @var INavigationManager */
- private $navigationManager;
-
public function __construct(
$appName,
IRequest $request,
@@ -57,7 +54,6 @@ class PersonalSettingsController extends Controller {
* @NoSubadminRequired
*/
public function index($section) {
- $this->navigationManager->setActiveEntry('personal');
return $this->getIndexResponse('personal', $section);
}