Fix for endless loop in outputHtml()
[mailer.git] / inc / extensions-functions.php
index 359b09fe45e45d5a3ae7bd93e0279d4c48b2a8a1..1d9027656f76f07ea216801e24c0a75d484c4b62 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()) {
-                                               // 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