Skip to content

Commit

Permalink
Merge pull request #163 from PrestaShop/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienPapet authored Apr 5, 2023
2 parents 5d7c4bf + 2fd0238 commit 06763bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>gsitemap</name>
<displayName><![CDATA[Google sitemap]]></displayName>
<version><![CDATA[4.2.1]]></version>
<version><![CDATA[4.3.0]]></version>
<description><![CDATA[Generate your Google sitemap file]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[seo]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion gsitemap-cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down
10 changes: 5 additions & 5 deletions gsitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ 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;
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_,
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 06763bb

Please sign in to comment.