From 4a1eb3dc2afa7946d7ad930535e1dc5a4db8a801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 16 Jun 2025 12:01:16 +0200 Subject: [PATCH] fix: Correctly ignore lazy ghost initialization in debug warning about direct constructor call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/public/AppFramework/App.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index eec5c6e83e9a8..2cf976ce90a35 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -9,6 +9,7 @@ */ namespace OCP\AppFramework; +use OC\AppFramework\Utility\SimpleContainer; use OC\ServerContainer; use OCP\IConfig; use OCP\Server; @@ -70,9 +71,10 @@ public function __construct(string $appName, array $urlParams = []) { $setUpViaQuery = true; break; } elseif (isset($step['class'], $step['function'], $step['args'][0]) && - $step['class'] === \ReflectionClass::class && - $step['function'] === 'initializeLazyObject' && + $step['class'] === SimpleContainer::class && + preg_match('/{closure:OC\\\\AppFramework\\\\Utility\\\\SimpleContainer::buildClass\\(\\):\\d+}/', $step['function']) && $step['args'][0] === $this) { + /* We are setup through a lazy ghost, fine */ $setUpViaQuery = true; break; }