Skip to content
Draft
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
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ private function ldap2NextcloudNames(array $ldapObjects, bool $isUsers): array {
if (is_null($nameByLDAP)) {
continue;
}
$sndName = $ldapObject[$sndAttribute][0] ?? '';
$sndName = $sndAttribute !== null ? ($ldapObject[$sndAttribute][0] ?? '') : '';
$this->applyUserDisplayName($ncName, $nameByLDAP, $sndName);
} elseif ($nameByLDAP !== null) {
$this->cacheGroupDisplayName($ncName, $nameByLDAP);
Expand Down
8 changes: 4 additions & 4 deletions lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public function join($fromAlias, $join, $alias, $condition = null) {
$this->queryBuilder->join(
$this->quoteAlias($fromAlias),
$this->getTableName($join),
$this->quoteAlias($alias),
$this->quoteAlias($alias) ?? '',
$condition
);

Expand Down Expand Up @@ -754,7 +754,7 @@ public function innerJoin($fromAlias, $join, $alias, $condition = null) {
$this->queryBuilder->innerJoin(
$this->quoteAlias($fromAlias),
$this->getTableName($join),
$this->quoteAlias($alias),
$this->quoteAlias($alias) ?? '',
$condition
);

Expand Down Expand Up @@ -783,7 +783,7 @@ public function leftJoin($fromAlias, $join, $alias, $condition = null) {
$this->queryBuilder->leftJoin(
$this->quoteAlias($fromAlias),
$this->getTableName($join),
$this->quoteAlias($alias),
$this->quoteAlias($alias) ?? '',
$condition
);

Expand Down Expand Up @@ -812,7 +812,7 @@ public function rightJoin($fromAlias, $join, $alias, $condition = null) {
$this->queryBuilder->rightJoin(
$this->quoteAlias($fromAlias),
$this->getTableName($join),
$this->quoteAlias($alias),
$this->quoteAlias($alias) ?? '',
$condition
);

Expand Down
9 changes: 9 additions & 0 deletions lib/public/Cache/CappedMemoryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function __construct(int $capacity = 512) {
*/
#[\Override]
public function hasKey($key): bool {
if ($key === null) {
return false;
}
return isset($this->cache[$key]);
}

Expand All @@ -46,6 +49,9 @@ public function hasKey($key): bool {
*/
#[\Override]
public function get($key) {
if ($key === null) {
return null;
}
return $this->cache[$key] ?? null;
}

Expand Down Expand Up @@ -73,6 +79,9 @@ public function set($key, $value, $ttl = 0): bool {
*/
#[\Override]
public function remove($key): bool {
if ($key === null) {
return false;
}
unset($this->cache[$key]);
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/DB/QueryBuilder/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public static function dataJoin(): array {
return [
[
'd1', 'data2', null, null,
['`d1`' => [['joinType' => 'inner', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => null, 'joinCondition' => null]]],
['`d1`' => [['joinType' => 'inner', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => '', 'joinCondition' => null]]],
'`*PREFIX*data1` `d1` INNER JOIN `*PREFIX*data2` '
],
[
Expand Down Expand Up @@ -613,7 +613,7 @@ public static function dataLeftJoin(): array {
return [
[
'd1', 'data2', null, null,
['`d1`' => [['joinType' => 'left', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => null, 'joinCondition' => null]]],
['`d1`' => [['joinType' => 'left', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => '', 'joinCondition' => null]]],
'`*PREFIX*data1` `d1` LEFT JOIN `*PREFIX*data2` '
],
[
Expand Down Expand Up @@ -663,7 +663,7 @@ public static function dataRightJoin(): array {
return [
[
'd1', 'data2', null, null,
['`d1`' => [['joinType' => 'right', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => null, 'joinCondition' => null]]],
['`d1`' => [['joinType' => 'right', 'joinTable' => '`*PREFIX*data2`', 'joinAlias' => '', 'joinCondition' => null]]],
'`*PREFIX*data1` `d1` RIGHT JOIN `*PREFIX*data2` '
],
[
Expand Down
Loading