Переглянути джерело

Let's at least check if the function exists first (any mod should be able to include files from the hook itself)

Signed-off-by: emanuele <[email protected]>
emanuele 12 роки тому
батько
коміт
b393d70f02
1 змінених файлів з 7 додано та 4 видалено
  1. 7 4
      index.php

+ 7 - 4
index.php

@@ -231,14 +231,17 @@ function smf_main()
 	}
 	elseif (empty($_REQUEST['action']))
 	{
-		// Action and board are both empty... BoardIndex!
+		// Action and board are both empty... BoardIndex! Unless someone else wants to do something different.
 		if (empty($board) && empty($topic))
 		{
-			$call = 'BoardIndex';
+			$call = '';
 			call_integration_hook('integrate_default_action', $call);
-			require_once($sourcedir . '/' . $call . '.php');
+			if (!empty($call) && function_exists($call))
+				return $call;
 
-			return $call;
+			require_once($sourcedir . '/BoardIndex.php');
+
+			return 'BoardIndex';
 		}
 		// Topic is empty, and action is empty.... MessageIndex!
 		elseif (empty($topic))