[BUGFIX] Mirror selection is not respected
authorXavier Perseguers <xavier@typo3.org>
Mon, 1 Aug 2011 20:56:46 +0000 (22:56 +0200)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 1 Aug 2011 21:33:44 +0000 (23:33 +0200)
When a specific mirror is selected in Extension Manager,
the method used to return it fails.

Change-Id: Ibb60edec1a7fac4e3c217aad47d9332f7edd5fc6
Resolves: #27755
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/3999
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Steffen Kamper
Tested-by: Steffen Kamper
typo3/sysext/em/classes/settings/class.tx_em_settings.php

index 9517e03..efb0fdb 100644 (file)
@@ -200,7 +200,14 @@ class tx_em_Settings implements t3lib_Singleton {
                        $url = 'http://' . $mirrors[$rand]['host'] . $mirrors[$rand]['path'];
                }
                else {
-                       $url = 'http://' . $mirrors[$this->settings['selectedMirror']]['host'] . $mirrors[$this->settings['selectedMirror']]['path'];
+                       $selectedMirror = NULL;
+                       foreach ($mirrors as $mirror) {
+                               if ($mirror['host'] === $this->settings['selectedMirror']) {
+                                       $selectedMirror = $mirror;
+                                       break;
+                               }
+                       }
+                       $url = 'http://' . $selectedMirror['host'] . $selectedMirror['path'];
                }
 
                return $url;