Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
545f8066
Unverified
Commit
545f8066
authored
4 years ago
by
Morris Jobke
Browse files
Options
Downloads
Patches
Plain Diff
Use array_filter instead
Signed-off-by:
Morris Jobke
<
hey@morrisjobke.de
>
parent
97c49b0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/Command/Preview/Repair.php
+9
-10
9 additions, 10 deletions
core/Command/Preview/Repair.php
with
9 additions
and
10 deletions
core/Command/Preview/Repair.php
+
9
−
10
View file @
545f8066
...
...
@@ -112,30 +112,29 @@ class Repair extends Command {
* by default there could be 0-9 a-f and the old-multibucket folder which are all fine
*/
if
(
$total
<
18
)
{
foreach
(
$directoryListing
as
$index
=>
$dir
)
{
$directoryListing
=
array_filter
(
$directoryListing
,
function
(
$dir
)
{
if
(
$dir
->
getName
()
===
'old-multibucket'
)
{
unset
(
$directoryListing
[
$index
])
;
return
false
;
}
// a-f can't be a file ID -> removing from migration
if
(
preg_match
(
'!^[a-f]$!'
,
$dir
->
getName
()))
{
unset
(
$directoryListing
[
$index
])
;
return
false
;
}
if
(
preg_match
(
'!^[0-9]$!'
,
$dir
->
getName
()))
{
// ignore folders that only has folders in them
if
(
$dir
instanceof
Folder
)
{
$hasFile
=
false
;
foreach
(
$dir
->
getDirectoryListing
()
as
$entry
)
{
if
(
!
$entry
instanceof
Folder
)
{
$hasFile
=
true
;
break
;
return
true
;
}
}
if
(
!
$hasFile
)
{
unset
(
$directoryListing
[
$index
]);
}
return
false
;
}
}
}
return
true
;
});
$total
=
count
(
$directoryListing
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment