Skip to content
Merged
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 lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getAll(): array {

public function get($key) {
$result = null;
[$scope, $id] = explode(':', $key, 2);
[$scope] = explode(':', $key, 2);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[$scope] = explode(':', $key, 2);
[$scope] = explode(':', $key, 1);

if you don't care about the rest :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that would basically not explode the value at all:

If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string.

$foo = explode(':', 'a:b:c:d', 1);
array(1) {
  [0]=>
  string(7) "a:b:c:d"
}

switch ($scope) {
case 'groupLimit':
if (!$this->groupManager->isAdmin($this->userId)) {
Expand Down