mirror of
https://github.com/nextcloud/server.git
synced 2026-04-28 17:48:40 -04:00
Refactor "substr" calls to improve code readability
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
This commit is contained in:
parent
f934d23cf2
commit
df0a396b4c
1 changed files with 2 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue