73b561ed33
- edubox-tools.patch : getShopDomain/Ssl conservent les ports non standards - edubox-configuration.patch : PS_SHOP_DOMAIN, _PS_BASE_URL_, PS_SSL_ENABLED… résolus dynamiquement - edubox-shop-getbaseurl.patch : Shop::getBaseURL() utilise le host de la requête - edubox-shopurl.patch : getMainShopDomain conserve les ports non standards - edubox-clear-cache-init.sh : vidage des caches à chaque démarrage - seed.ts : passage au tag 9-edubox-9 - README mis à jour avec les nouveaux patches
29 lines
991 B
Diff
29 lines
991 B
Diff
--- a/src/Core/Context/ShopContext.php
|
|
+++ b/src/Core/Context/ShopContext.php
|
|
@@ -9,6 +9,7 @@ declare(strict_types=1);
|
|
|
|
namespace PrestaShop\PrestaShop\Core\Context;
|
|
|
|
+use Tools;
|
|
use PrestaShop\PrestaShop\Core\Domain\Shop\ValueObject\ShopConstraint;
|
|
|
|
/**
|
|
@@ -121,11 +122,12 @@ class ShopContext
|
|
|
|
public function getBaseURL(): string
|
|
{
|
|
- if ($this->secured) {
|
|
- $url = 'https://' . $this->domainSSL;
|
|
- } else {
|
|
- $url = 'http://' . $this->domain;
|
|
- }
|
|
+ // EduBox: behind a reverse proxy with dynamic public domains the shop
|
|
+ // URL stored in the database is never the real public URL. Rebuild the
|
|
+ // base URL from the current request instead.
|
|
+ $secure = Tools::usingSecureMode();
|
|
+ $domain = $secure ? Tools::getShopDomainSsl(false, false) : Tools::getShopDomain(false, false);
|
|
+ $url = ($secure ? 'https://' : 'http://') . $domain;
|
|
|
|
return $url . $this->getBaseURI();
|
|
}
|