Remove leading slash from sharing activity

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/2695/head
Joas Schilling 8 years ago
parent 3714a6aaf0
commit 6de0eb0b74
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
  1. 2
      apps/comments/lib/Activity/Provider.php
  2. 5
      apps/files/lib/Activity/FavoriteProvider.php
  3. 5
      apps/files/lib/Activity/Provider.php
  4. 2
      apps/files_sharing/lib/Activity/Providers/Downloads.php
  5. 2
      apps/files_sharing/lib/Activity/Providers/Groups.php
  6. 2
      apps/files_sharing/lib/Activity/Providers/PublicLinks.php
  7. 2
      apps/files_sharing/lib/Activity/Providers/Users.php
  8. 2
      apps/sharebymail/lib/Activity.php
  9. 2
      lib/public/RichObjectStrings/Definitions.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]),
];
}

@ -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]);
}
}

@ -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]),
];
}

@ -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]),
];
}

@ -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]),
];
}

@ -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]),
];
}

@ -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]),
];
}

@ -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]),
];
}

@ -191,7 +191,7 @@ class Definitions {
'path' => [
'since' => '11.0.0',
'required' => true,
'description' => 'The full path of the file for the user',
'description' => 'The full path of the file for the user, should not start with a slash',
'example' => 'path/to/file.txt',
],
'link' => [

Loading…
Cancel
Save