Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/appstore/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ public function listApps(bool $details = false): DataResponse {

$appData['groups'] = $groups;
// analyze dependencies
$ignoreMax = in_array($appData['id'], $ignoreMaxApps);
$ignoreMax = in_array($appData['id'], $ignoreMaxApps, true);
$missing = $this->dependencyAnalyzer->analyze($appData, $ignoreMax);
$appData['missingDependencies'] = $missing;
$appData['isCompatible'] = $this->dependencyAnalyzer->isMarkedCompatible($appData);
$appData['internal'] = in_array($appData['id'], $this->appManager->getAlwaysEnabledApps());
$appData['internal'] = in_array($appData['id'], $this->appManager->getAlwaysEnabledApps(), true);

return $appData;
}, $apps);
Expand Down Expand Up @@ -332,7 +332,7 @@ private function fetchApps(): void {
$supportedApps = $this->subscriptionRegistry->delegateGetSupportedApps();
$shippedApps = $this->appManager->getAlwaysEnabledApps();
foreach ($apps as $app) {
if (in_array($app['id'], $shippedApps)) {
if (in_array($app['id'], $shippedApps, true)) {
// shipped apps are no longer published on the appstore
// so skip them to avoid confusion with outdated data
continue;
Expand All @@ -345,7 +345,7 @@ private function fetchApps(): void {
$this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]);
}

if (in_array($app['id'], $supportedApps)) {
if (in_array($app['id'], $supportedApps, true)) {
$this->allApps[$app['id']]['level'] = \OC_App::supportedApp;
}
}
Expand Down Expand Up @@ -463,7 +463,7 @@ private function getAppsForCategory(string $requestedCategory = ''): array {
'license' => $app['releases'][0]['licenses'],
'author' => $authors,
'shipped' => $this->appManager->isShipped($app['id']),
'internal' => in_array($app['id'], $this->appManager->getAlwaysEnabledApps()),
'internal' => in_array($app['id'], $this->appManager->getAlwaysEnabledApps(), true),
'version' => $currentVersion,
'types' => [],
'documentation' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
}

$supportedShareTypes = $this->config->getSupportedShareTypes($resourceType);
// $shareType is an untyped parameter taken directly from the OCS request body
/** @psalm-suppress UnrecognizedExpression */
if (!in_array($shareType, $supportedShareTypes)) {
return new JSONResponse(
['message' => 'Share type "' . $shareType . '" not implemented'],
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/lib/Listener/CommentsEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function handle(Event $event): void {
CommentsEvent::EVENT_UPDATE,
CommentsEvent::EVENT_DELETE,
];
if (in_array($eventType, $applicableEvents)) {
if (in_array($eventType, $applicableEvents, true)) {
$this->notificationHandler($event);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/Controller/DashboardApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function getShownWidgets(array $widgetIds): array {
return array_filter(
$this->dashboardManager->getWidgets(),
static function (IWidget $widget) use ($widgetIds) {
return in_array($widget->getId(), $widgetIds);
return in_array($widget->getId(), $widgetIds, true);
},
);
}
Expand Down
5 changes: 3 additions & 2 deletions apps/dav/appinfo/v1/publicwebdav.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use OCP\L10N\IFactory as IL10nFactory;
use OCP\Security\Bruteforce\IThrottler;
use OCP\Server;
use OCP\Share\IShare;
use Psr\Log\LoggerInterface;

// load needed apps
Expand Down Expand Up @@ -96,7 +97,7 @@ function (\Sabre\DAV\Server $server) use (
$linkCheckPlugin,
$filesDropPlugin
) {
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''));
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''), true);
/** @var FederatedShareProvider $shareProvider */
$federatedShareProvider = Server::get(FederatedShareProvider::class);
if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && !$isAjax) {
Expand Down Expand Up @@ -132,7 +133,7 @@ function (\Sabre\DAV\Server $server) use (
Filesystem::logWarningWhenAddingStorageWrapper($previousLog);

$rootFolder = Server::get(IRootFolder::class);
$userId = $share->getShareType() === \OCP\Share\IShare::TYPE_REMOTE
$userId = $share->getShareType() === IShare::TYPE_REMOTE
? $share->getShareOwner()
: $share->getSharedBy();
$userFolder = $rootFolder->getUserFolder($userId);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/appinfo/v2/publicremote.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
// GET must be allowed for e.g. showing images and allowing Zip downloads
if ($server->httpRequest->getMethod() !== 'GET') {
// If this is *not* a GET request we only allow access to public DAV from AJAX or when Server2Server is allowed
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''));
$isAjax = in_array('XMLHttpRequest', explode(',', $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ''), true);
$federatedShareProvider = Server::get(FederatedShareProvider::class);
if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && $isAjax === false) {
// this is what is thrown when trying to access a non-existing share
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ protected function getObjectNameAndType(array $objectData) {
$vObject = Reader::read($objectData['calendardata']);
$component = $componentType = null;
foreach ($vObject->getComponents() as $component) {
if (in_array($component->name, ['VEVENT', 'VTODO'])) {
if (in_array($component->name, ['VEVENT', 'VTODO'], true)) {
$componentType = $component->name;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/CachedSubscriptionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar
$calendarInfos = $this->calDavBackend->getSubscriptionsForUser($principalUri);

if (count($calendarUris) > 0) {
$calendarInfos = array_filter($calendarInfos, fn (array $subscription) => in_array($subscription['uri'], $calendarUris));
$calendarInfos = array_filter($calendarInfos, fn (array $subscription) => in_array($subscription['uri'], $calendarUris, true));
}

$calendarInfos = array_values(array_filter($calendarInfos));
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ public function calendarSearch($principalUri, array $filters, $limit = null, $of
$result = [];
while ($row = $stmt->fetchAssociative()) {
$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
if (!in_array($path, $result)) {
if (!in_array($path, $result, true)) {
$result[] = $path;
}
}
Expand Down Expand Up @@ -3043,7 +3043,7 @@ public function createSubscription($principalUri, $uri, array $properties) {
foreach ($this->subscriptionPropertyMap as $xmlName => [$dbName, $type]) {
if (array_key_exists($xmlName, $properties)) {
$values[$dbName] = $properties[$xmlName];
if (in_array($dbName, $propertiesBoolean)) {
if (in_array($dbName, $propertiesBoolean, true)) {
$values[$dbName] = true;
}
}
Expand Down Expand Up @@ -3684,7 +3684,7 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend

$indexComponents = ['VEVENT', 'VJOURNAL', 'VTODO'];
foreach ($vCalendar->getComponents() as $component) {
if (!in_array($component->name, $indexComponents)) {
if (!in_array($component->name, $indexComponents, true)) {
continue;
}

Expand All @@ -3708,7 +3708,7 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend
$indexedParametersForProperty = self::INDEXED_PARAMETERS[$property->name];

foreach ($parameters as $key => $value) {
if (in_array($key, $indexedParametersForProperty)) {
if (in_array($key, $indexedParametersForProperty, true)) {
// is this a shitty db?
if ($this->db->supports4ByteText()) {
$value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value);
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/CalendarProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar

if (!empty($calendarUris)) {
$calendarInfos = array_filter($calendarInfos, function ($calendar) use ($calendarUris) {
return in_array($calendar['uri'], $calendarUris);
return in_array($calendar['uri'], $calendarUris, true);
});

$federatedCalendarInfos = array_filter($federatedCalendarInfos, function ($federatedCalendar) use ($calendarUris) {
return in_array($federatedCalendar['uri'], $calendarUris);
return in_array($federatedCalendar['uri'], $calendarUris, true);
});
}

Expand Down
5 changes: 4 additions & 1 deletion apps/dav/lib/CalDAV/EventReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function __construct(VCalendar|VEvent|array|string $input, ?string $uid =
// evaluate if start date is floating
// set duration to 24 hours and calculate the end date
// according to the rfc any event without a end date or duration is a complete day
elseif ($this->baseEventStartDateFloating == true) {
elseif ($this->baseEventStartDateFloating === true) {
$this->baseEventDuration = 86400;
$this->baseEventEndDate = DateTimeImmutable::createFromInterface($this->baseEventStartDate)
->setTimestamp($this->baseEventStartDate->getTimestamp() + $this->baseEventDuration);
Expand Down Expand Up @@ -739,6 +739,9 @@ public function recurrenceAdvance(): void {
$nextExceptionDate = $edateDate;
}
// if the next date is part of exrule or exdate find another date
// loose comparison needed: DateTime value equality, not instance identity
// (type comes from an untyped Iterator::current(), so psalm can't verify it statically)
/** @psalm-suppress UnrecognizedExpression */
if ($nextOccurrenceDate !== null && $nextExceptionDate !== null && $nextOccurrenceDate == $nextExceptionDate) {
$this->recurrenceCurrentDate = $nextOccurrenceDate;
$this->recurrenceAdvance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private function getAllEMailAddressesFromEvent(VEvent $vevent):array {
}

$cuType = $this->getCUTypeOfAttendee($attendee);
if (\in_array($cuType, ['RESOURCE', 'ROOM', 'UNKNOWN'])) {
if (\in_array($cuType, ['RESOURCE', 'ROOM', 'UNKNOWN'], true)) {
// Don't send emails to things
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ public function schedule(Message $iTipMessage) {
$invitationLinkRecipients = explode(',', preg_replace('/\s+/', '', strtolower($this->config->getValueString('dav', 'invitation_link_recipients', 'yes'))));

if (strcmp('yes', $invitationLinkRecipients[0]) === 0
|| in_array(strtolower($recipient), $invitationLinkRecipients)
|| in_array(strtolower($recipientDomain), $invitationLinkRecipients)) {
|| in_array(strtolower($recipient), $invitationLinkRecipients, true)
|| in_array(strtolower($recipientDomain), $invitationLinkRecipients, true)) {
$token = $this->imipService->createInvitationToken($iTipMessage, $vEvent, $lastOccurrence);
$this->imipService->addResponseButtons($template, $token);
$this->imipService->addMoreOptionsButton($template, $token);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Schedule/IMipService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ public function isCircle(Property $attendee): bool {

public function minimizeInterval(\DateInterval $dateInterval): array {
// evaluate if time interval is in the past
if ($dateInterval->invert == 1) {
if ($dateInterval->invert === 1) {
return ['interval' => 1, 'scale' => 'past'];
}
// evaluate interval parts and return smallest time period
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Status/StatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function getCalendarEvents(User $user): array {
}

$sct = $calendarObject->getSchedulingTransparency();
if ($sct !== null && strtolower($sct->getValue()) == ScheduleCalendarTransp::TRANSPARENT) {
if ($sct !== null && strtolower($sct->getValue()) === ScheduleCalendarTransp::TRANSPARENT) {
// If a calendar is marked as 'transparent', it means we must
// ignore it for free-busy purposes.
continue;
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CardDAV/AddressBookImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected function vCard2Array($uri, VCard $vCard, $withTypes = false) {
];

foreach ($vCard->children() as $property) {
if ($property->name === 'PHOTO' && in_array($property->getValueType(), ['BINARY', 'URI'])) {
if ($property->name === 'PHOTO' && in_array($property->getValueType(), ['BINARY', 'URI'], true)) {
$url = $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkTo('', 'remote.php') . '/dav/');
$url .= implode('/', [
Expand All @@ -270,7 +270,7 @@ protected function vCard2Array($uri, VCard $vCard, $withTypes = false) {
]) . '?photo';

$result['PHOTO'] = 'VALUE=uri:' . $url;
} elseif (in_array($property->name, ['URL', 'GEO', 'CLOUD', 'ADR', 'EMAIL', 'IMPP', 'TEL', 'X-SOCIALPROFILE', 'RELATED', 'LANG', 'X-ADDRESSBOOKSERVER-MEMBER'])) {
} elseif (in_array($property->name, ['URL', 'GEO', 'CLOUD', 'ADR', 'EMAIL', 'IMPP', 'TEL', 'X-SOCIALPROFILE', 'RELATED', 'LANG', 'X-ADDRESSBOOKSERVER-MEMBER'], true)) {
if (!isset($result[$property->name])) {
$result[$property->name] = [];
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ protected function updateProperties($addressBookId, $cardUri, $vCardSerialized)
);

foreach ($vCard->children() as $property) {
if (!in_array($property->name, self::INDEXED_PROPERTIES)) {
if (!in_array($property->name, self::INDEXED_PROPERTIES, true)) {
continue;
}
$preferred = 0;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Comments/CommentsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function onReport($reportName, $report, $uri) {
];
$ns = '{' . $this::NS_OWNCLOUD . '}';
foreach ($report as $parameter) {
if (!in_array($parameter['name'], $acceptableParameters) || empty($parameter['value'])) {
if (!in_array($parameter['name'], $acceptableParameters, true) || empty($parameter['value'])) {
continue;
}
$args[str_replace($ns, '', $parameter['name'])] = $parameter['value'];
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/LegacyPublicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function validateUserPass($username, $password) {
&& $this->session->get(PublicAuth::DAV_AUTHENTICATED) === $share->getId()) {
return true;
} else {
if (in_array('XMLHttpRequest', explode(',', $this->request->getHeader('X-Requested-With')))) {
if (in_array('XMLHttpRequest', explode(',', $this->request->getHeader('X-Requested-With')), true)) {
// do not re-authenticate over ajax, use dummy auth name to prevent browser popup
http_response_code(401);
header('WWW-Authenticate: DummyBasic realm="' . $this->realm . '"');
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function beforeReport(RequestInterface $request, ResponseInterface $respo
* @return bool
*/
public function report($reportName, $report, $path) {
if ($reportName == '{DAV:}principal-property-search' && $this->isMacOSDavAgent) {
if ($reportName === '{DAV:}principal-property-search' && $this->isMacOSDavAgent) {
/** @var \Sabre\DAVACL\Xml\Request\PrincipalPropertySearchReport $report */
$report->applyToPrincipalCollectionSet = true;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function check(RequestInterface $request, ResponseInterface $response) {
private function requiresCSRFCheck(): bool {

$methodsWithoutCsrf = ['GET', 'HEAD', 'OPTIONS'];
if (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {
if (in_array($this->request->getMethod(), $methodsWithoutCsrf, true)) {
return false;
}

Expand Down Expand Up @@ -204,7 +204,7 @@ private function auth(RequestInterface $request, ResponseInterface $response): a
$startPos = strrpos($data[1], '/') + 1;
$user = $this->userSession->getUser()->getUID();
$data[1] = substr_replace($data[1], $user, $startPos);
} elseif (in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With') ?? ''))) {
} elseif (in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With') ?? ''), true)) {
// For ajax requests use dummy auth name to prevent browser popup in case of invalid creditials
$response->addHeader('WWW-Authenticate', 'DummyBasic realm="' . $this->realm . '"');
$response->setStatus(Http::STATUS_UNAUTHORIZED);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/CachingTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function markDirty($path) {
$path = trim($path, '/');
foreach ($this->cache as $nodePath => $node) {
$nodePath = (string)$nodePath;
if ($path === '' || $nodePath == $path || str_starts_with($nodePath, $path . '/')) {
if ($path === '' || $nodePath === $path || str_starts_with($nodePath, $path . '/')) {
unset($this->cache[$nodePath]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function prepareResponses($filesUri, $requestedProps, $nodes) {
$result['href'] = $propFind->getPath();

$resourceType = $this->server->getResourceTypeForNode($node);
if (in_array('{DAV:}collection', $resourceType) || in_array('{DAV:}principal', $resourceType)) {
if (in_array('{DAV:}collection', $resourceType, true) || in_array('{DAV:}principal', $resourceType, true)) {
$result['href'] .= '/';
}

Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/PublicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function validateUserPass($username, $password) {
return true;
}

if (in_array('XMLHttpRequest', explode(',', $this->request->getHeader('X-Requested-With')))) {
if (in_array('XMLHttpRequest', explode(',', $this->request->getHeader('X-Requested-With')), true)) {
// do not re-authenticate over ajax, use dummy auth name to prevent browser popup
http_response_code(401);
header('WWW-Authenticate: DummyBasic realm="' . $this->realm . '"');
Expand Down Expand Up @@ -245,6 +245,6 @@ private function isShareInSession(IShare $share): bool {
return false;
}

return in_array($share->getId(), $allowedShareIds);
return in_array($share->getId(), $allowedShareIds, true);
}
}
2 changes: 2 additions & 0 deletions apps/dav/lib/Controller/InvitationResponseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public function processMoreOptionsResult(string $token):TemplateResponse {
$partstat = $this->request->getParam('partStat');

$row = $this->getTokenInformation($token);
// $partstat comes from IRequest::getParam(), which is untyped
/** @psalm-suppress UnrecognizedExpression */
if (!$row || !\in_array($partstat, ['ACCEPTED', 'DECLINED', 'TENTATIVE'])) {
return new TemplateResponse($this->appName, 'schedule-response-error', [], 'guest');
}
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/lib/DAV/CustomPropertiesBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function propFind($path, PropFind $propFind): void {
];

foreach ($customPropertiesForShares as $customPropertyForShares) {
if (in_array($customPropertyForShares, $allRequestedProps)) {
if (in_array($customPropertyForShares, $allRequestedProps, true)) {
$requestedProps[] = $customPropertyForShares;
}
}
Expand Down Expand Up @@ -276,11 +276,11 @@ public function propFind($path, PropFind $propFind): void {
}

private function isPropertyAllowed(string $property): bool {
if (in_array($property, self::IGNORED_PROPERTIES)) {
if (in_array($property, self::IGNORED_PROPERTIES, true)) {
return false;
}
if (str_starts_with($property, '{http://owncloud.org/ns}') || str_starts_with($property, '{http://nextcloud.org/ns}')) {
return in_array($property, self::ALLOWED_NC_PROPERTIES);
return in_array($property, self::ALLOWED_NC_PROPERTIES, true);
}
return true;
}
Expand Down Expand Up @@ -651,7 +651,7 @@ private function encodeValueForDatabase(string $path, string $name, mixed $value
"Property \"$name\" has an invalid value of type " . gettype($value),
);
} else {
if (!in_array($value::class, self::ALLOWED_SERIALIZED_CLASSES)) {
if (!in_array($value::class, self::ALLOWED_SERIALIZED_CLASSES, true)) {
throw new DavException(
"Property \"$name\" has an invalid value of class " . $value::class,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/DAV/Sharing/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function applyShareAcl(array $shares, array $acl): array {
'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
'protected' => true,
];
} elseif (in_array($this->service->getResourceType(), ['calendar','addressbook'])) {
} elseif (in_array($this->service->getResourceType(), ['calendar','addressbook'], true)) {
// Allow changing the properties of read only calendars,
// so users can change the visibility.
$acl[] = [
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Files/FileSearchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function getPropertyDefinitionsForMetadata(): array {
$metadata = $this->filesMetadataManager->getKnownMetadata();
$indexes = $metadata->getIndexes();
foreach ($metadata->getKeys() as $key) {
$isIndex = in_array($key, $indexes);
$isIndex = in_array($key, $indexes, true);
$type = match ($metadata->getType($key)) {
IMetadataValueWrapper::TYPE_INT => SearchPropertyDefinition::DATATYPE_INTEGER,
IMetadataValueWrapper::TYPE_FLOAT => SearchPropertyDefinition::DATATYPE_DECIMAL,
Expand Down
Loading
Loading