aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-27 21:38:47 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-27 21:38:47 +0100
commit688a4022df1978b87be1720424c4507f3db79e39 (patch)
tree953b223643a2e783af57f2c544af4ce65ea55758 /apps
parentd2e53d1022ac4977739d3f159008e652115ed1b5 (diff)
parent8c48be453ec39f7a6283c7087229ed76fe128d0a (diff)
downloadnextcloud-server-688a4022df1978b87be1720424c4507f3db79e39.tar.gz
nextcloud-server-688a4022df1978b87be1720424c4507f3db79e39.zip
Merge pull request #13012 from owncloud/small_fix
only send activity if we have a valid path and the file is readable
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index 8b04fbd0341..69de717611c 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -231,22 +231,20 @@ class ShareController extends Controller {
$originalSharePath = self::getPath($token);
if (isset($originalSharePath) && Filesystem::isReadable($originalSharePath . $path)) {
- $getPath = Filesystem::normalizePath($path);
- $originalSharePath = Filesystem::normalizePath($originalSharePath . $getPath);
- $type = \OC\Files\Filesystem::is_dir($originalSharePath) ? 'folder' : 'file';
- $args = $type === 'folder' ? array('dir' => $originalSharePath) : array('dir' => dirname($originalSharePath), 'scrollto' => basename($originalSharePath));
- $linkToFile = \OCP\Util::linkToAbsolute('files', 'index.php', $args);
+ $originalSharePath = Filesystem::normalizePath($originalSharePath . $path);
+ $type = \OC\Files\Filesystem::is_dir($originalSharePath) ? 'folder' : 'file';
+ $args = $type === 'folder' ? array('dir' => $originalSharePath) : array('dir' => dirname($originalSharePath), 'scrollto' => basename($originalSharePath));
+ $linkToFile = \OCP\Util::linkToAbsolute('files', 'index.php', $args);
+ $subject = $type === 'folder' ? Activity::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED : Activity::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED;
+ $this->activityManager->publishActivity(
+ 'files_sharing', $subject, array($originalSharePath), '', array(), $originalSharePath,
+ $linkToFile, $linkItem['uid_owner'], Activity::TYPE_PUBLIC_LINKS, Activity::PRIORITY_MEDIUM);
}
- $subject = $type === 'folder' ? Activity::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED : Activity::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED;
- $this->activityManager->publishActivity(
- 'files_sharing', $subject, array($originalSharePath), '', array(),
- $originalSharePath, $linkToFile, $linkItem['uid_owner'], Activity::TYPE_PUBLIC_LINKS, Activity::PRIORITY_MEDIUM);
-
if (!is_null($files)) { // download selected files
$files_list = json_decode($files);
// in case we get only a single file
- if ($files_list === NULL ) {
+ if ($files_list === NULL) {
$files_list = array($files);
}