Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[-] MO : fixed bugs on RSS modules

  • Loading branch information...
commit e442785fe7246951dd99880a5021c317173df198 1 parent a17dc13
@DamienMetzger DamienMetzger authored
View
2  install-dev/data/theme.sql
@@ -53,7 +53,7 @@ UPDATE `PREFIX_configuration` SET value = 'CAT2,CAT3,CAT4' WHERE name = 'MOD_BLO
UPDATE `PREFIX_configuration` SET value = '' WHERE name = 'MOD_BLOCKTOPMENU_SEARCH';
UPDATE `PREFIX_configuration` SET value = 'http://www.facebook.com/prestashop' WHERE name = 'blocksocial_facebook';
UPDATE `PREFIX_configuration` SET value = 'http://www.twitter.com/prestashop' WHERE name = 'blocksocial_twitter';
-UPDATE `PREFIX_configuration` SET value = 'RSS' WHERE name = 'blocksocial_rss';
+UPDATE `PREFIX_configuration` SET value = 'http://www.prestashop.com/blog/en/feed/' WHERE name = 'blocksocial_rss';
UPDATE `PREFIX_configuration` SET value = 'My Company' WHERE name = 'blockcontactinfos_company';
UPDATE `PREFIX_configuration` SET value = '42 avenue des Champs Elysées\n75000 Paris\nFrance' WHERE name = 'blockcontactinfos_address';
UPDATE `PREFIX_configuration` SET value = '+33 (0)1.23.45.67.89' WHERE name = 'blockcontactinfos_phone';
View
2  install-dev/data/xml/configuration.xml
@@ -633,7 +633,7 @@
<value>http://www.twitter.com/prestashop</value>
</configuration>
<configuration id="blocksocial_rss" name="blocksocial_rss">
- <value>RSS</value>
+ <value>http://www.prestashop.com/blog/en/feed/</value>
</configuration>
<configuration id="blockcontactinfos_company" name="blockcontactinfos_company">
<value>Your company</value>
View
4 modules/blockrss/blockrss.php
@@ -69,7 +69,7 @@ public function getContent()
$title = Tools::getValue('title');
$nbr = (int)Tools::getValue('nbr');
- if ($urlfeed AND !Validate::isUrl($urlfeed))
+ if ($urlfeed AND !Validate::isAbsoluteUrl($urlfeed))
$errors[] = $this->l('Invalid feed URL');
elseif (!$title OR empty($title) OR !Validate::isGenericName($title))
$errors[] = $this->l('Invalid title');
@@ -77,7 +77,7 @@ public function getContent()
$errors[] = $this->l('Invalid number of feeds');
elseif (stristr($urlfeed, $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
$errors[] = $this->l('You have selected a feed URL on your own website. Please choose another URL');
- elseif (!($contents = @file_get_contents($urlfeed)))
+ elseif (!($contents = Tools::file_get_contents($urlfeed)))
$errors[] = $this->l('Feed is unreachable, check your URL');
/* Even if the feed was reachable, We need to make sure that the feed is well formated */
else
View
2  modules/feeder/config.xml
@@ -2,7 +2,7 @@
<module>
<name>feeder</name>
<displayName><![CDATA[RSS products feed]]></displayName>
- <version><![CDATA[0.2]]></version>
+ <version><![CDATA[0.3]]></version>
<description><![CDATA[Generate a RSS products feed]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
View
12 modules/feeder/feeder.php
@@ -35,7 +35,7 @@ public function __construct()
{
$this->name = 'feeder';
$this->tab = 'front_office_features';
- $this->version = 0.2;
+ $this->version = 0.3;
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -48,17 +48,13 @@ public function __construct()
function install()
{
- if (!parent::install())
- return false;
- if (!$this->registerHook('header'))
- return false;
- return true;
+ return (parent::install() && $this->registerHook('header'));
}
function hookHeader($params)
{
- $id_category = (int)(Tools::getValue('id_category'));
- if (!$id_category)
+
+ if (!($id_category = (int)Tools::getValue('id_category')))
{
if (isset($_SERVER['HTTP_REFERER']) && preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) && !strstr($_SERVER['HTTP_REFERER'], '.html'))
{
Please sign in to comment.
Something went wrong with that request. Please try again.