Fixed bug #1044: Indexed Search results always on same page as search
[Packages/TYPO3.CMS.git] / typo3 / mod.php
index 3fad29c..f236694 100644 (file)
@@ -50,20 +50,19 @@ if ($temp_path = $TBE_MODULES['_PATHS'][$temp_M]) {
        $BACK_PATH = '';
        require($temp_path . 'index.php');
        $isDispatched = TRUE;
-} else {       
+} else {
        if (is_array($TBE_MODULES['_dispatcher'])) {
-               foreach ($TBE_MODULES['_dispatcher'] as $dispatcher) {
-                       if (is_object($dispatcher)) {
-                               if ($dispatcher->callModule($temp_M) === TRUE) {
-                                       $isDispatched = TRUE;
-                                       break;
-                               }
+               foreach ($TBE_MODULES['_dispatcher'] as $dispatcherClassName) {
+                       $dispatcher = t3lib_div::makeInstance($dispatcherClassName);
+                       if ($dispatcher->callModule($temp_M) === TRUE) {
+                               $isDispatched = TRUE;
+                               break;
                        }
                }
        }
 }
 
 if ($isDispatched === FALSE) {
-       die('Value "' . htmlspecialchars($temp_M) . '" for "M" was not found as a module'); 
+       die('Value "' . htmlspecialchars($temp_M) . '" for "M" was not found as a module');
 }
 ?>
\ No newline at end of file