From 0166ff5ff599e998651d6a8db4a22e66c4fc16b2 Mon Sep 17 00:00:00 2001 From: DanielSeifert Date: Thu, 24 Jul 2014 09:21:40 +0000 Subject: [PATCH] =?UTF-8?q?#2782:=20=5Fd3GetNonBaseLanguageUrls()=20liefer?= =?UTF-8?q?t=20falsche=20URLs=20wenn=20die=20SSL-Verbindung=20=C3=BCber=20?= =?UTF-8?q?eine=20Subdomain=20l=C3=A4uft?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../d3_oxcmp_utils_googleanalytics.php | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php b/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php index 274d82b..ad9898f 100644 --- a/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php +++ b/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php @@ -123,26 +123,45 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare { $myConfig = oxRegistry::getConfig(); $aLanguageUrls = $myConfig->getConfigParam('aLanguageURLs'); - $aUrls = array(); - /** @var oxUBase $oActView */ - $oActView = $myConfig->getTopActiveView(); + $aSslLanguageUrls = $myConfig->getConfigParam('aLanguageSSLURLs'); + $aUrls = array(); if ($myConfig->getConfigParam('bl_perfLoadLanguages')) { $aLanguages = oxRegistry::getLang()->getLanguageArray(null, true, true); reset($aLanguages); - while ((list($sKey, $oVal) = each($aLanguages))) { - $aLanguages[$sKey]->link = $oActView->getLink($oVal->id); - $sUrl = str_replace('http://', '', $aLanguageUrls[$oVal->id]); - - if ($aLanguageUrls[$oVal->id] != $aLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) { - $aUrls[] = "'".$sUrl."'"; - } + foreach ($aLanguages as $oVal) { + $aUrls = $this->_d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls); } } return $aUrls; } + /** + * @param $aLanguageUrls + * @param $oVal + * @param $aSslLanguageUrls + * @param $aUrls + * + * @return array + */ + protected function _d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls) + { + $sUrl = str_replace('http://', '', $aLanguageUrls[$oVal->id]); + $sSslUrl = str_replace('https://', '', $aSslLanguageUrls[$oVal->id]); + + if ($aLanguageUrls[$oVal->id] != $aLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) { + $aUrls[] = "'" . $sUrl . "'"; + } + if ($aSslLanguageUrls[$oVal->id] != $aSslLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) { + $aUrls[] = "'" . $sSslUrl . "'"; + + return $aUrls; + } + + return $aUrls; + } + /** * @return string */