fix(prestashop): image edubox-prestashop fonctionne en local et derrière proxy
- 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
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
--- a/classes/Tools.php 2026-06-04 14:48:44.000000000 +0000
|
||||
+++ b/classes/Tools.php 2026-06-23 16:34:13.226899992 +0000
|
||||
@@ -269,8 +269,10 @@
|
||||
*/
|
||||
public static function getShopDomain($http = false, $entities = false)
|
||||
{
|
||||
- if (!$domain = ShopUrl::getMainShopDomain()) {
|
||||
- $domain = Tools::getHttpHost();
|
||||
+ // EduBox: dynamic domain + keep non-standard ports (e.g. localhost:8088).
|
||||
+ $domain = Tools::getHttpHost(false, false, false);
|
||||
+ if (substr($domain, -3) === ':80' || substr($domain, -4) === ':443') {
|
||||
+ $domain = substr($domain, 0, strrpos($domain, ':'));
|
||||
}
|
||||
if ($entities) {
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
@@ -292,14 +294,16 @@
|
||||
*/
|
||||
public static function getShopDomainSsl($http = false, $entities = false)
|
||||
{
|
||||
- if (!$domain = ShopUrl::getMainShopDomainSSL()) {
|
||||
- $domain = Tools::getHttpHost();
|
||||
+ // EduBox: dynamic domain + keep non-standard ports.
|
||||
+ $domain = Tools::getHttpHost(false, false, false);
|
||||
+ if (substr($domain, -3) === ':80' || substr($domain, -4) === ':443') {
|
||||
+ $domain = substr($domain, 0, strrpos($domain, ':'));
|
||||
}
|
||||
if ($entities) {
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
if ($http) {
|
||||
- $domain = static::getProtocol((bool) Configuration::get('PS_SSL_ENABLED')) . $domain;
|
||||
+ $domain = static::getProtocol(Tools::usingSecureMode()) . $domain;
|
||||
}
|
||||
|
||||
return $domain;
|
||||
@@ -2246,7 +2250,7 @@
|
||||
$rewrite_settings = (int) Configuration::get('PS_REWRITING_SETTINGS', null, null, (int) $uri['id_shop']);
|
||||
}
|
||||
|
||||
- $domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^' . $domain . '$' . PHP_EOL;
|
||||
+ $domain_rewrite_cond = ''; // EduBox: removed HTTP_HOST condition for dynamic domains
|
||||
// Rewrite virtual multishop uri
|
||||
if ($uri['virtual']) {
|
||||
if (!$rewrite_settings) {
|
||||
Reference in New Issue
Block a user