From e495bd68ad70b9c09add85abfd4c90d6bad078d6 Mon Sep 17 00:00:00 2001 From: tokul Date: Tue, 4 Oct 2005 17:21:10 +0000 Subject: [PATCH] simplified check. thanks, Jon. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10132 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/plugin.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/functions/plugin.php b/functions/plugin.php index 280e4146..8cf261b7 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -199,11 +199,12 @@ function is_plugin_enabled($plugin_name) { global $plugins; /** - * check if variable is set. can't do is_array(), if variable is not set - * check if it is an array - * there is no need to call in_array() if $plugins array is empty + * check if variable is empty. if var is not set, php empty + * returns true without error notice. + * + * then check if it is an array */ - if (! isset($plugins) || ! is_array($plugins) || empty($plugins)) + if (empty($plugins) || ! is_array($plugins)) return false; if ( in_array($plugin_name,$plugins) ) { -- 2.25.1