From 31c608c9891b81084e0e8b90baef3672e12d6bac Mon Sep 17 00:00:00 2001 From: Fabien Papet Date: Fri, 17 Feb 2023 12:43:59 +0100 Subject: [PATCH 1/4] Update gsitemap.php --- gsitemap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsitemap.php b/gsitemap.php index f97e601..92121c5 100755 --- a/gsitemap.php +++ b/gsitemap.php @@ -213,7 +213,7 @@ public function getContent() $store_url = $this->context->link->getBaseLink(); $this->context->smarty->assign([ 'gsitemap_form' => './index.php?tab=AdminModules&configure=gsitemap&token=' . Tools::getAdminTokenLite('AdminModules') . '&tab_module=' . $this->tab . '&module_name=gsitemap', - 'gsitemap_cron' => $store_url . 'modules/gsitemap/gsitemap-cron.php?token=' . Tools::substr(Tools::encrypt('gsitemap/cron'), 0, 10) . '&id_shop=' . $this->context->shop->id, + 'gsitemap_cron' => $store_url . 'modules/gsitemap/gsitemap-cron.php?token=' . Tools::substr(Tools::hash('gsitemap/cron'), 0, 10) . '&id_shop=' . $this->context->shop->id, 'gsitemap_feed_exists' => file_exists($this->normalizeDirectory(_PS_ROOT_DIR_) . 'index_sitemap.xml'), 'gsitemap_last_export' => Configuration::get('GSITEMAP_LAST_EXPORT'), 'gsitemap_frequency' => Configuration::get('GSITEMAP_FREQUENCY'), @@ -296,11 +296,11 @@ public function addLinkToSitemap(&$link_sitemap, $new_link, $lang, &$index, &$i, return false; } elseif ($index % 20 == 0 && $this->cron) { - header('Refresh: 5; url=http' . (Configuration::get('PS_SSL_ENABLED') ? 's' : '') . '://' . Tools::getShopDomain(false, true) . __PS_BASE_URI__ . 'modules/gsitemap/gsitemap-cron.php?continue=1&token=' . Tools::substr(Tools::encrypt('gsitemap/cron'), 0, 10) . '&type=' . $new_link['type'] . '&lang=' . $lang . '&index=' . $index . '&id=' . (int) $id_obj . '&id_shop=' . $this->context->shop->id); + header('Refresh: 5; url=http' . (Configuration::get('PS_SSL_ENABLED') ? 's' : '') . '://' . Tools::getShopDomain(false, true) . __PS_BASE_URI__ . 'modules/gsitemap/gsitemap-cron.php?continue=1&token=' . Tools::substr(Tools::hash('gsitemap/cron'), 0, 10) . '&type=' . $new_link['type'] . '&lang=' . $lang . '&index=' . $index . '&id=' . (int) $id_obj . '&id_shop=' . $this->context->shop->id); exit(); } else { if ($this->cron) { - Tools::redirect($this->context->link->getBaseLink() . 'modules/gsitemap/gsitemap-cron.php?continue=1&token=' . Tools::substr(Tools::encrypt('gsitemap/cron'), 0, 10) . '&type=' . $new_link['type'] . '&lang=' . $lang . '&index=' . $index . '&id=' . (int) $id_obj . '&id_shop=' . $this->context->shop->id); + Tools::redirect($this->context->link->getBaseLink() . 'modules/gsitemap/gsitemap-cron.php?continue=1&token=' . Tools::substr(Tools::hash('gsitemap/cron'), 0, 10) . '&type=' . $new_link['type'] . '&lang=' . $lang . '&index=' . $index . '&id=' . (int) $id_obj . '&id_shop=' . $this->context->shop->id); } else { Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true, [], [ 'tab_module' => $this->tab, From 0d146e814f2766093dc4ebe00cf6ecbf95a0d92e Mon Sep 17 00:00:00 2001 From: Fabien Papet Date: Fri, 17 Feb 2023 12:46:04 +0100 Subject: [PATCH 2/4] Replace in cron --- gsitemap-cron.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsitemap-cron.php b/gsitemap-cron.php index ebdd8c4..2185b55 100644 --- a/gsitemap-cron.php +++ b/gsitemap-cron.php @@ -34,7 +34,7 @@ if (!Tools::isPHPCLI()) { include dirname(__FILE__) . '/../../init.php'; - if (Tools::substr(Tools::encrypt('gsitemap/cron'), 0, 10) != Tools::getValue('token') || !Module::isInstalled('gsitemap')) { + if (Tools::substr(Tools::hash('gsitemap/cron'), 0, 10) != Tools::getValue('token') || !Module::isInstalled('gsitemap')) { exit('Bad token'); } } From d14baa3d8a9298d2e58f258776fb21af93c836ae Mon Sep 17 00:00:00 2001 From: lartist Date: Fri, 31 Mar 2023 08:12:16 +0200 Subject: [PATCH 3/4] Fix wording --- README.md | 2 +- gsitemap.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e41ecb..694932c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## About -Generate your Google sitemap file with this module, and keep it up-to-date. +Generate your Google sitemap file and keep it up to date with this module. ## Multistore compatibility diff --git a/gsitemap.php b/gsitemap.php index 92121c5..9e7fb98 100755 --- a/gsitemap.php +++ b/gsitemap.php @@ -56,7 +56,7 @@ public function __construct() $this->bootstrap = true; parent::__construct(); $this->displayName = $this->trans('Google sitemap', [], 'Modules.Gsitemap.Admin'); - $this->description = $this->trans('Generate your Google sitemap file with this module, and keep it up-to-date.', [], 'Modules.Gsitemap.Admin'); + $this->description = $this->trans('Generate your Google sitemap file and keep it up to date with this module.', [], 'Modules.Gsitemap.Admin'); $this->ps_versions_compliancy = [ 'min' => '1.7.1.0', 'max' => _PS_VERSION_, From 3e589da6736a5d4ac33d58e8a4ddba4c1ee86039 Mon Sep 17 00:00:00 2001 From: Fabien Papet Date: Fri, 31 Mar 2023 14:54:51 +0200 Subject: [PATCH 4/4] Bump module version --- config.xml | 2 +- gsitemap.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index e3a2fe7..de47d8e 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ gsitemap - + diff --git a/gsitemap.php b/gsitemap.php index 92121c5..db8950b 100755 --- a/gsitemap.php +++ b/gsitemap.php @@ -50,7 +50,7 @@ public function __construct() { $this->name = 'gsitemap'; $this->tab = 'checkout'; - $this->version = '4.2.1'; + $this->version = '4.3.0'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true;