summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-16 13:20:27 +0100
committerGitHub <noreply@github.com>2016-12-16 13:20:27 +0100
commit6fd421cc3c4c34e010d1ca21063e6209998c78f2 (patch)
treeb17327b9df7c7bc26b4407ff319234ae12e57d1e /apps
parent09d5c557e71562e06afb5e72610fc838cde252ef (diff)
parent6de0eb0b741ff1cf0b735480a6c2d2fbcb1e70ca (diff)
downloadnextcloud-server-6fd421cc3c4c34e010d1ca21063e6209998c78f2.tar.gz
nextcloud-server-6fd421cc3c4c34e010d1ca21063e6209998c78f2.zip
Merge pull request #2695 from nextcloud/remove-leading-slashes-on-share-activity
Remove leading slash from sharing activity
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/lib/Activity/Provider.php2
-rw-r--r--apps/files/lib/Activity/FavoriteProvider.php5
-rw-r--r--apps/files/lib/Activity/Provider.php5
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Downloads.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Groups.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/PublicLinks.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Users.php2
-rw-r--r--apps/sharebymail/lib/Activity.php2
8 files changed, 12 insertions, 10 deletions
diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php
index 170b20d7c27..c55982827b3 100644
--- a/apps/comments/lib/Activity/Provider.php
+++ b/apps/comments/lib/Activity/Provider.php
@@ -206,7 +206,7 @@ class Provider implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php
index 8047eb1319e..ed00d50f221 100644
--- a/apps/files/lib/Activity/FavoriteProvider.php
+++ b/apps/files/lib/Activity/FavoriteProvider.php
@@ -142,10 +142,11 @@ class FavoriteProvider implements IProvider {
'type' => 'file',
'id' => $event->getObjectId(),
'name' => basename($event->getObjectName()),
- 'path' => $event->getObjectName(),
+ 'path' => trim($event->getObjectName(), '/'),
+ 'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $event->getObjectId()]),
];
- $event->setParsedSubject(str_replace('{file}', trim($parameter['path'], '/'), $subject))
+ $event->setParsedSubject(str_replace('{file}', $parameter['path'], $subject))
->setRichSubject($subject, ['file' => $parameter]);
}
}
diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php
index 92686ec0c36..ae303034610 100644
--- a/apps/files/lib/Activity/Provider.php
+++ b/apps/files/lib/Activity/Provider.php
@@ -201,7 +201,7 @@ class Provider implements IProvider {
foreach ($parameters as $placeholder => $parameter) {
$placeholders[] = '{' . $placeholder . '}';
if ($parameter['type'] === 'file') {
- $replacements[] = trim($parameter['path'], '/');
+ $replacements[] = $parameter['path'];
} else {
$replacements[] = $parameter['name'];
}
@@ -253,7 +253,8 @@ class Provider implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
+ 'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/files_sharing/lib/Activity/Providers/Downloads.php b/apps/files_sharing/lib/Activity/Providers/Downloads.php
index e1a25156441..01012e4785b 100644
--- a/apps/files_sharing/lib/Activity/Providers/Downloads.php
+++ b/apps/files_sharing/lib/Activity/Providers/Downloads.php
@@ -187,7 +187,7 @@ class Downloads implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/files_sharing/lib/Activity/Providers/Groups.php b/apps/files_sharing/lib/Activity/Providers/Groups.php
index 326ebba9ef7..6c25572d0d4 100644
--- a/apps/files_sharing/lib/Activity/Providers/Groups.php
+++ b/apps/files_sharing/lib/Activity/Providers/Groups.php
@@ -232,7 +232,7 @@ class Groups implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
index ec8152c5a32..20070970bca 100644
--- a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
+++ b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
@@ -239,7 +239,7 @@ class PublicLinks implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/files_sharing/lib/Activity/Providers/Users.php b/apps/files_sharing/lib/Activity/Providers/Users.php
index d85eeadc315..4db72136a85 100644
--- a/apps/files_sharing/lib/Activity/Providers/Users.php
+++ b/apps/files_sharing/lib/Activity/Providers/Users.php
@@ -260,7 +260,7 @@ class Users implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}
diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php
index 5342d013ade..1c2f37dc382 100644
--- a/apps/sharebymail/lib/Activity.php
+++ b/apps/sharebymail/lib/Activity.php
@@ -196,7 +196,7 @@ class Activity implements IProvider {
'type' => 'file',
'id' => $id,
'name' => basename($path),
- 'path' => $path,
+ 'path' => trim($path, '/'),
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
];
}