From 5ca959fa688255a8de61f89fe2751eb4d24a6912 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Tue, 22 Mar 2016 09:22:07 -0400
Subject: [PATCH] fixed typo

---
 interface/lib/classes/plugin.inc.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/interface/lib/classes/plugin.inc.php b/interface/lib/classes/plugin.inc.php
index 8abb77c..8a8ac20 100644
--- a/interface/lib/classes/plugin.inc.php
+++ b/interface/lib/classes/plugin.inc.php
@@ -45,12 +45,12 @@
 		if(isset($_SESSION['s']['plugin_cache'])) unset($_SESSION['s']['plugin_cache']);
 		
 		$plugin_dirs = array();
-		$plugin_dirs[] = ISPC_LIB_PATH.FS_DIV.'plugins'.FS_DIV;
+		$plugin_dirs[] = ISPC_LIB_PATH.FS_DIV.'plugins';
 		
 		if(is_dir(ISPC_WEB_PATH)) {
 			if($dh = opendir(ISPC_WEB_PATH)) {
 				while(($file = readdir($dh)) !== false) {
-					if($file !== '.' && $file !== '..' && is_dir($file) && is_dir(ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d')) $plugin_dirs[] = ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d';
+					if($file !== '.' && $file !== '..' && is_dir(ISPC_WEB_PATH . FS_DIV . $file) && is_dir(ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d')) $plugin_dirs[] = ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d';
 				}
 				closedir($dh);
 			}
@@ -63,6 +63,7 @@
 			$plugins_dir = $plugin_dirs[$d];
 			if (is_dir($plugins_dir)) {
 				if ($dh = opendir($plugins_dir)) {
+					$tmp_plugins = array();
 					//** Go trough all files in the plugin dir
 					while (($file = readdir($dh)) !== false) {
 						if($file !== '.' && $file !== '..' && substr($file, -8, 8) == '.inc.php') {
@@ -76,7 +77,7 @@
 
 					//** load the plugins
 					foreach($tmp_plugins as $plugin_name => $file) {
-						include_once $plugins_dir.$file;
+						require $plugins_dir . FS_DIV . $file;
 						if($this->debug) $app->log('Loading plugin: '.$plugin_name, LOGLEVEL_DEBUG);
 						$app->loaded_plugins[$plugin_name] = new $plugin_name;
 						$app->loaded_plugins[$plugin_name]->onLoad();
@@ -120,7 +121,7 @@
 
 		if(is_array($sub_events)) {
 			if(count($sub_events) == 3) {
-				$mp_event = $sub_events[2];
+				$tmp_event = $sub_events[2];
 				if($this->debug) $app->log("Called Event '$tmp_event'", LOGLEVEL_DEBUG);
 				$tmpresult = $this->callPluginEvent($tmp_event, $data, $return_data);
 				if($return_data == true && $tmpresult) $result .= $tmpresult;
@@ -187,7 +188,6 @@
 
 					$tmpresult = call_user_func(array($app->loaded_plugins[$plugin_name], $function_name), $event_name, $data);
 					if($return_data == true && $tmpresult) $result .= $tmpresult;
-
 				}
 			}
 

--
Gitblit v1.9.1