From fbb3c1225bc587a32121bbf62006434dbfdfba59 Mon Sep 17 00:00:00 2001 From: Dirk Baumeister Date: Tue, 22 Nov 2016 14:05:26 +0100 Subject: [PATCH 1/6] updated toxidcurl to prevent redirect loop when settings are empty --- core/toxidcurl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/toxidcurl.php b/core/toxidcurl.php index 2f65ae2..a8509bf 100644 --- a/core/toxidcurl.php +++ b/core/toxidcurl.php @@ -305,6 +305,9 @@ protected function _getXmlObject($blReset = false) */ protected function _getSnippetFromXml($sSnippet) { + if(str_replace("/","",$this->_getToxidLangSource()) == '') + return ''; + $oTypo3Xml = $this->_getXmlObject(); $aXpathSnippets = $oTypo3Xml->xpath('//' . $sSnippet . '[1]'); $sText = $aXpathSnippets[0]; From ee79c202c569ba514d447eb7f18570610cdac343 Mon Sep 17 00:00:00 2001 From: Oliver P Date: Wed, 29 Mar 2017 10:40:25 +0200 Subject: [PATCH 2/6] Update toxid_curl_oxseodecoder.php --- core/toxid_curl_oxseodecoder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/toxid_curl_oxseodecoder.php b/core/toxid_curl_oxseodecoder.php index 7d79bbf..6a0c4d8 100644 --- a/core/toxid_curl_oxseodecoder.php +++ b/core/toxid_curl_oxseodecoder.php @@ -87,7 +87,7 @@ private function isToxidUrl($sSeoUrl) $decodedToxidUrl = $this->detectToxidAndLang($sSeoUrl); if (false !== $decodedToxidUrl) { $this->decodedUrl['toxidUrl'] = $decodedToxidUrl['url']; - $languageId = oxRegistry::getLang()->getBaseLanguage(); + $languageId = $decodedToxidUrl['lang']; $this->decodedUrl['toxidLang'] = $this->processToxidLangByUrl($languageId, $this->decodedUrl['toxidUrl']); return true; From 286cff1b13384ca79bce5155ede081d1e32c6fd2 Mon Sep 17 00:00:00 2001 From: Oliver P Date: Wed, 3 May 2017 16:48:30 +0200 Subject: [PATCH 3/6] added missing ssl support the ssl url was never used here... --- core/toxidcurl.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/toxidcurl.php b/core/toxidcurl.php index a8509bf..fca1156 100644 --- a/core/toxidcurl.php +++ b/core/toxidcurl.php @@ -488,12 +488,22 @@ protected function _rewriteUrls($sContent, $iLangId = null, $blMultiLang = false */ protected function _getToxidLangSource($iLangId = null, $blReset = false) { - if ($this->_aSourceUrlByLang === null || $blReset) { - $this->_aSourceUrlByLang = $this->getConfig()->getConfigParam('aToxidCurlSource'); - } if ($iLangId === null) { $iLangId = oxRegistry::getLang()->getBaseLanguage(); } + + if ($this->_aSourceUrlByLang === null || $blReset) { + + $oConf = $this->getConfig(); + if ($oConf->isSsl() && $this->getConfig()->getConfigParam('aToxidCurlSourceSsl')[$iLangId]!="") { + $this->_aSourceUrlByLang = $this->getConfig()->getConfigParam('aToxidCurlSourceSsl'); + } else { + $this->_aSourceUrlByLang = $this->getConfig()->getConfigParam('aToxidCurlSource'); + } + + + } + $source = $this->_aSourceUrlByLang[$iLangId]; if (substr($source, -1) !== '/') { From dcf7a9230f1f204fd7c96efd464a7b16b8fa32f5 Mon Sep 17 00:00:00 2001 From: Oliver P Date: Thu, 11 May 2017 15:54:37 +0200 Subject: [PATCH 4/6] Added ssl function for shop url --- core/toxidcurl.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/toxidcurl.php b/core/toxidcurl.php index fca1156..e259cb8 100644 --- a/core/toxidcurl.php +++ b/core/toxidcurl.php @@ -436,6 +436,10 @@ protected function _rewriteUrls($sContent, $iLangId = null, $blMultiLang = false foreach ($aLanguages as $iLangId) { $sShopUrl = $this->getConfig()->getShopUrl(); + $oConf = $this->getConfig(); + if ($oConf->isSsl()) { + $sShopUrl = str_replace('http','https',$sShopUrl); + } if (substr($sShopUrl, -1) !== '/') { $sShopUrl = $sShopUrl . '/'; From d6fdbf52c3e1fd9ea032816bd084a513a96d40b5 Mon Sep 17 00:00:00 2001 From: Oliver P Date: Thu, 11 May 2017 16:08:37 +0200 Subject: [PATCH 5/6] added condition to disable ssl verify check for devmode --- core/toxidcurl.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/toxidcurl.php b/core/toxidcurl.php index e259cb8..b6ee6a7 100644 --- a/core/toxidcurl.php +++ b/core/toxidcurl.php @@ -390,6 +390,12 @@ protected function _getRemoteContent($sUrl) curl_setopt($curl_handle, CURLOPT_URL, $sUrl); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); + + if ($this->getConfig()->getActiveShop()->getFieldData('OXPRODUCTIVE') == 0) { + curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false); + } + if (!$this->isToxidCurlPage()) { curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true); } From bbe2fe0772c969164f316e10c255bd10d5be5890 Mon Sep 17 00:00:00 2001 From: Oliver P Date: Fri, 9 Jun 2017 12:59:59 +0200 Subject: [PATCH 6/6] fixed replacement of http --- core/toxidcurl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/toxidcurl.php b/core/toxidcurl.php index b6ee6a7..0455e1f 100644 --- a/core/toxidcurl.php +++ b/core/toxidcurl.php @@ -444,7 +444,7 @@ protected function _rewriteUrls($sContent, $iLangId = null, $blMultiLang = false $sShopUrl = $this->getConfig()->getShopUrl(); $oConf = $this->getConfig(); if ($oConf->isSsl()) { - $sShopUrl = str_replace('http','https',$sShopUrl); + $sShopUrl = str_replace('http:','https:',$sShopUrl); } if (substr($sShopUrl, -1) !== '/') {