From 286bdf91d4f839b60d92fcbf22fd0c4cbda06e90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Dec 2013 16:25:27 +0100 Subject: [PATCH] Better detection of corrupted module files. --- htdocs/admin/triggers.php | 2 +- htdocs/core/class/interfaces.class.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 980bd9ef4bb..2b930b8afc1 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2013 Laurent Destailleur * * 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 diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 78276c27885..db39f7bab86 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -259,6 +259,12 @@ class Interfaces $modName = $modules[$key]; if (empty($modName)) continue; + if (! class_exists($modName)) + { + print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."
\n"; + continue; + } + $objMod = new $modName($this->db); // Define disabledbyname and disabledbymodule