Skip to content
Merged
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 appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* 🌉 **Sync with other chat solutions** With [Matterbridge](https://github.com/42wim/matterbridge/) being integrated in Talk, you can easily sync a lot of other chat solutions to Nextcloud Talk and vice-versa.
]]></description>

<version>20.1.10</version>
<version>20.1.11</version>
<licence>agpl</licence>

<author>Anna Larch</author>
Expand Down
19 changes: 18 additions & 1 deletion lib/MatterbridgeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function editBridgeOfRoom(Room $room, string $userId, bool $enabled, arra
$newBridge = [
'enabled' => $enabled,
'pid' => $currentBridge['pid'] ?? 0,
'parts' => $parts,
'parts' => $this->validateParts($parts),
];

$this->notify($room, $userId, $currentBridge, $newBridge);
Expand Down Expand Up @@ -335,6 +335,7 @@ private function generatePassword(): string {
private function generateConfig(array $bridge): string {
$content = '';
foreach ($bridge['parts'] as $k => $part) {
$k = (int)$k;
$type = $part['type'];

if ($type === 'nctalk') {
Expand Down Expand Up @@ -494,6 +495,22 @@ private function generateConfig(array $bridge): string {
return $content;
}

protected function validateParts(array $parts): array {
foreach ($parts as $k => $part) {
if (!is_numeric($k)) {
$this->logger->error('User tried to configure a malicious matterbridge setup');
throw new \InvalidArgumentException('Invalid matterbridge parameters');
}
foreach ($part as $key => $value) {
if (preg_match('/["\n]/', $key) || preg_match('/["\n]/', $value)) {
$this->logger->error('User tried to configure a malicious matterbridge setup');
throw new \InvalidArgumentException('Invalid matterbridge parameters');
}
}
}
return $parts;
}

/**
* Remove the scheme from an URL and add port
*
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "talk",
"version": "20.1.10",
"version": "20.1.11",
"private": true,
"description": "",
"author": "Joas Schilling <[email protected]>",
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1221,11 +1221,12 @@ public function userGetsTheRoomForPath(string $user, string $path, int $statusCo
}

/**
* @Then /^user "([^"]*)" propfinds path "([^"]*)"$/
* @param string $user
* @param string $path
* @return int
*/
private function getFileIdForPath($user, $path) {
public function getFileIdForPath($user, $path) {
$this->setCurrentUser($user);

$url = "/$user/$path";
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/features/conversation-2/files.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Feature: conversation/files
Given user "participant1" shares "welcome.txt" with user "participant2" with OCS 100
And user "participant2" accepts last share
And user "participant1" deletes last share
# FIXME Temporary workaround, should be removed when possible. See https://github.com/nextcloud/spreed/pull/15726 for details
When user "participant2" propfinds path "welcome.txt"
When user "participant1" gets the room for path "welcome.txt" with 404 (v1)


Expand Down
Loading