aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-02-24 09:19:09 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2025-02-24 09:19:09 +0100
commit61189814e3ea0dad8a6c7c9b72ff7143c9e8836c (patch)
treebfc2b81e768f030ec5226ebeb04f5bb388c0f65a
parentc1204c06704a97a5bfaa4bb41f4428ea873c6031 (diff)
downloadnextcloud-server-61189814e3ea0dad8a6c7c9b72ff7143c9e8836c.tar.gz
nextcloud-server-61189814e3ea0dad8a6c7c9b72ff7143c9e8836c.zip
fix(admin_audit): Fix incorrect truncation of files path in admin audit logfix/fix-admin-audit-paths
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--apps/admin_audit/lib/Actions/Files.php16
-rw-r--r--apps/admin_audit/lib/Listener/FileEventListener.php2
2 files changed, 9 insertions, 9 deletions
diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php
index 3993f1a76ee..f07ed254272 100644
--- a/apps/admin_audit/lib/Actions/Files.php
+++ b/apps/admin_audit/lib/Actions/Files.php
@@ -37,7 +37,7 @@ class Files extends Action {
$node = $event->getNode();
$params = [
'id' => $node instanceof NonExistingFile ? null : $node->getId(),
- 'path' => mb_substr($node->getInternalPath(), 5),
+ 'path' => $node->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
@@ -76,8 +76,8 @@ class Files extends Action {
$originalSource = $this->renamedNodes[$target->getId()];
$params = [
'newid' => $target->getId(),
- 'oldpath' => mb_substr($originalSource->getInternalPath(), 5),
- 'newpath' => mb_substr($target->getInternalPath(), 5),
+ 'oldpath' => $originalSource->getPath(),
+ 'newpath' => $target->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
@@ -101,7 +101,7 @@ class Files extends Action {
try {
$params = [
'id' => $event->getNode()->getId(),
- 'path' => mb_substr($event->getNode()->getInternalPath(), 5),
+ 'path' => $event->getNode()->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
@@ -127,8 +127,8 @@ class Files extends Action {
$params = [
'oldid' => $event->getSource()->getId(),
'newid' => $event->getTarget()->getId(),
- 'oldpath' => mb_substr($event->getSource()->getInternalPath(), 5),
- 'newpath' => mb_substr($event->getTarget()->getInternalPath(), 5),
+ 'oldpath' => $event->getSource()->getPath(),
+ 'newpath' => $event->getTarget()->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
@@ -151,7 +151,7 @@ class Files extends Action {
try {
$params = [
'id' => $node->getId(),
- 'path' => mb_substr($node->getInternalPath(), 5),
+ 'path' => $node->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
@@ -177,7 +177,7 @@ class Files extends Action {
try {
$params = [
'id' => $event->getNode()->getId(),
- 'path' => mb_substr($event->getNode()->getInternalPath(), 5),
+ 'path' => $event->getNode()->getPath(),
];
} catch (InvalidPathException|NotFoundException $e) {
Server::get(LoggerInterface::class)->error(
diff --git a/apps/admin_audit/lib/Listener/FileEventListener.php b/apps/admin_audit/lib/Listener/FileEventListener.php
index 4ea3db6aa7d..04a106a5adf 100644
--- a/apps/admin_audit/lib/Listener/FileEventListener.php
+++ b/apps/admin_audit/lib/Listener/FileEventListener.php
@@ -40,7 +40,7 @@ class FileEventListener extends Action implements IEventListener {
'height' => $event->getHeight(),
'crop' => $event->isCrop(),
'mode' => $event->getMode(),
- 'path' => mb_substr($file->getInternalPath(), 5)
+ 'path' => $file->getPath(),
];
$this->log(
'Preview accessed: (id: "%s", width: "%s", height: "%s" crop: "%s", mode: "%s", path: "%s")',