[-] MO : block RSS encoding fixed #PSCFV-5689

This commit is contained in:
DamienMetzger
2012-11-22 17:52:46 +01:00
parent c11b283fca
commit 94731d6e6c
+7 -11
View File
@@ -65,9 +65,9 @@ class Blockrss extends Module
if (Tools::isSubmit('submitBlockRss')) if (Tools::isSubmit('submitBlockRss'))
{ {
$errors = array(); $errors = array();
$urlfeed = strval(Tools::getValue('urlfeed')); $urlfeed = Tools::getValue('urlfeed');
$title = strval(Tools::getValue('title')); $title = Tools::getValue('title');
$nbr = (int)(Tools::getValue('nbr')); $nbr = (int)Tools::getValue('nbr');
if ($urlfeed AND !Validate::isUrl($urlfeed)) if ($urlfeed AND !Validate::isUrl($urlfeed))
$errors[] = $this->l('Invalid feed URL'); $errors[] = $this->l('Invalid feed URL');
@@ -82,13 +82,9 @@ class Blockrss extends Module
/* Even if the feed was reachable, We need to make sure that the feed is well formated */ /* Even if the feed was reachable, We need to make sure that the feed is well formated */
else else
{ {
try try {
{
$xmlFeed = new XML_Feed_Parser($contents); $xmlFeed = new XML_Feed_Parser($contents);
} catch (XML_Feed_Parser_Exception $e) {
}
catch (XML_Feed_Parser_Exception $e)
{
$errors[] = $this->l('Invalid feed:').' '.$e->getMessage(); $errors[] = $this->l('Invalid feed:').' '.$e->getMessage();
} }
} }
@@ -124,13 +120,13 @@ class Blockrss extends Module
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Block title').'</label> <label>'.$this->l('Block title').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="title" value="'.htmlentities(Tools::getValue('title', Configuration::get('RSS_FEED_TITLE'))).'" /> <input type="text" name="title" value="'.Tools::safeOutput(Tools::getValue('title', Configuration::get('RSS_FEED_TITLE'))).'" />
<p class="clear">'.$this->l('Create a title for the block (default: \'RSS feed\')').'</p> <p class="clear">'.$this->l('Create a title for the block (default: \'RSS feed\')').'</p>
</div> </div>
<label>'.$this->l('Add a feed URL').'</label> <label>'.$this->l('Add a feed URL').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="85" name="urlfeed" value="'.htmlentities(Tools::getValue('urlfeed', Configuration::get('RSS_FEED_URL'))).'" /> <input type="text" size="85" name="urlfeed" value="'.Tools::safeOutput(Tools::getValue('urlfeed', Configuration::get('RSS_FEED_URL'))).'" />
<p class="clear">'.$this->l('Add the URL of the feed you want to use (sample: http://news.google.com/?output=rss)').'</p> <p class="clear">'.$this->l('Add the URL of the feed you want to use (sample: http://news.google.com/?output=rss)').'</p>
</div> </div>