summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-06-25 08:29:28 +0200
committerGitHub <noreply@github.com>2021-06-25 08:29:28 +0200
commite35ed31b31848bac58e85e097768df9fb54c3a6f (patch)
treebd76037b0138ab71b44de3693fb2e341c957de85 /lib
parent95447d0152abbd0ac04f097a1dfee51f9c2fcd83 (diff)
parent35a9ad0d787c4db0e22098025a410912bcb45854 (diff)
downloadnextcloud-server-e35ed31b31848bac58e85e097768df9fb54c3a6f.tar.gz
nextcloud-server-e35ed31b31848bac58e85e097768df9fb54c3a6f.zip
Merge pull request #27663 from nextcloud/fix/unshift-crash-reporters-break-loop
Unshift crash reports when they are loaded, to break the recusion
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Support/CrashReport/Registry.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/Support/CrashReport/Registry.php b/lib/private/Support/CrashReport/Registry.php
index a5c39de98f0..96796d6370f 100644
--- a/lib/private/Support/CrashReport/Registry.php
+++ b/lib/private/Support/CrashReport/Registry.php
@@ -35,6 +35,7 @@ use OCP\Support\CrashReport\IMessageReporter;
use OCP\Support\CrashReport\IRegistry;
use OCP\Support\CrashReport\IReporter;
use Throwable;
+use function array_shift;
class Registry implements IRegistry {
@@ -119,8 +120,7 @@ class Registry implements IRegistry {
}
private function loadLazyProviders(): void {
- $classes = $this->lazyReporters;
- foreach ($classes as $class) {
+ while (($class = array_shift($this->lazyReporters)) !== null) {
try {
/** @var IReporter $reporter */
$reporter = $this->serverContainer->query($class);
@@ -151,6 +151,5 @@ class Registry implements IRegistry {
]);
}
}
- $this->lazyReporters = [];
}
}