From bcd692ef6aa533d42a10ab3aba2f683018242f5b Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 16:16:24 +0100 Subject: [PATCH] Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname # Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname PhanTypeExpectedObjectOrClassName should be fixed by testing that the classname is not empty. --- htdocs/admin/webhook.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 7755856f8a0..4758220503d 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,18 +100,16 @@ if ($action == 'updateMask') { // Search template files $file = ''; $classname = ''; - $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0); if (file_exists($file)) { - $filefound = 1; $classname = "pdf_".$modele."_".strtolower($tmpobjectkey); break; } } - if ($filefound) { + if ($classname !== '') { require_once $file; $module = new $classname($db);