aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Service
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-02-23 19:45:56 +0100
committerGitHub <noreply@github.com>2024-02-23 19:45:56 +0100
commit816ddaf8b387f44c32bd1504ff205441162d572c (patch)
tree8cff1c5a1f0d04f3e04c13e3cb5e72bb7abfa97d /apps/files/lib/Service
parentd541a7d1788b8b9ce5b8b357d5a8a4b25348702e (diff)
parent344d99ae9456e45f95591e62cee665f5309cb5b8 (diff)
downloadnextcloud-server-816ddaf8b387f44c32bd1504ff205441162d572c.tar.gz
nextcloud-server-816ddaf8b387f44c32bd1504ff205441162d572c.zip
Merge pull request #39215 from shdehnavi/replace_substr_calls_in_files_app
Diffstat (limited to 'apps/files/lib/Service')
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index 3499d809f2c..77a4f8c0997 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -447,7 +447,7 @@ class OwnershipTransferService {
$progress = new ProgressBar($output, count($sourceShares));
$prefix = "$destinationUid/files";
$finalShareTarget = '';
- if (substr($finalTarget, 0, strlen($prefix)) === $prefix) {
+ if (str_starts_with($finalTarget, $prefix)) {
$finalShareTarget = substr($finalTarget, strlen($prefix));
}
foreach ($sourceShares as $share) {
@@ -457,7 +457,7 @@ class OwnershipTransferService {
if (trim($path, '/') !== '') {
$pathToCheck = '/' . trim($path) . '/';
}
- if (substr($share->getTarget(), 0, strlen($pathToCheck)) !== $pathToCheck) {
+ if (!str_starts_with($share->getTarget(), $pathToCheck)) {
continue;
}
$shareTarget = $share->getTarget();