Fix for endless loop in outputHtml()
[mailer.git] / inc / extensions-functions.php
index daac4a8..1d90276 100644 (file)
@@ -610,17 +610,23 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
                        if (count($depencies) > 0) {
                                // Apply all extension depencies
                                foreach ($depencies as $ext_depend) {
-                                       // Set it as current
-                                       setCurrentExtensionName($ext_depend);
-
-                                       // Is the extension there?
-                                       if (isExtensionInstalled($ext_depend)) {
-                                               // Update another extension first!
-                                               $test = updateExtension($ext_depend, getExtensionVersion($ext_depend), getExtensionDryRun());
-                                       } else {
-                                               // Register new extension
-                                               $test = registerExtension($ext_depend, 0, getExtensionDryRun(), false);
-                                       }
+                                       // Did we already update/register this?
+                                       if (!isset($GLOBALS['ext_updated'][$ext_depend])) {
+                                               // Set it as current
+                                               setCurrentExtensionName($ext_depend);
+
+                                               // Mark it as already updated before we update it
+                                               $GLOBALS['ext_updated'][$ext_depend] = true;
+
+                                               // Is the extension there?
+                                               if (isExtensionInstalled($ext_depend)) {
+                                                       // Update another extension first!
+                                                       $test = updateExtension($ext_depend, getExtensionVersion($ext_depend), getExtensionDryRun());
+                                               } else {
+                                                       // Register new extension
+                                                       $test = registerExtension($ext_depend, 0, getExtensionDryRun(), false);
+                                               }
+                                       } // END - if
                                } // END - foreach
 
                                // Set name back