Skip to content
Snippets Groups Projects
Commit c10d8a37 authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #22690 from owncloud/fix-comments-href-remote.php-files

ensure comments-href returns a value also when propfind is done again…
parents 21df2eb5 2b30136a
No related branches found
No related tags found
No related merge requests found
......@@ -99,13 +99,13 @@ class CommentPropertiesPlugin extends ServerPlugin {
*/
public function getCommentsLink(Node $node) {
$href = $this->server->getBaseUri();
$entryPoint = strrpos($href, '/webdav/');
$entryPoint = strpos($href, '/remote.php/');
if($entryPoint === false) {
// in case we end up somewhere else, unexpectedly.
return null;
}
$href = substr_replace($href, '/dav/', $entryPoint);
$href .= 'comments/files/' . rawurldecode($node->getId());
$commentsPart = 'dav/comments/files/' . rawurldecode($node->getId());
$href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/'));
return $href;
}
......
......@@ -84,7 +84,8 @@ class CommentsPropertiesPlugin extends \Test\TestCase {
public function baseUriProvider() {
return [
['owncloud/remote.php/webdav/', '4567', 'owncloud/remote.php/dav/comments/files/4567'],
['owncloud/remote.php/wicked/', '4567', null]
['owncloud/remote.php/files/', '4567', 'owncloud/remote.php/dav/comments/files/4567'],
['owncloud/wicked.php/files/', '4567', null]
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment