aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 20:58:38 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 20:58:38 +0100
commit7b4451912e2a9008a49854a2496cf9bb99b7ed10 (patch)
tree99b6c2173bb0b8a528050aac6fab4e633f6be355 /app/Models/Feed.php
parent318954dfbd64f7a29203cdb25a95400dea0cec0d (diff)
parent7eda2793bbc3210ae37aa66511fd7ad7661c2149 (diff)
Merge remote-tracking branch 'origin/dev' into beta
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php23
1 files changed, 8 insertions, 15 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 70efb0fa3..dcf97d4ec 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -15,7 +15,7 @@ class FreshRSS_Feed extends Minz_Model {
private $pathEntries = '';
private $httpAuth = '';
private $error = false;
- private $keep_history = false;
+ private $keep_history = -2;
public function __construct ($url, $validate=true) {
if ($validate) {
@@ -163,19 +163,12 @@ class FreshRSS_Feed extends Minz_Model {
$this->httpAuth = $value;
}
public function _error ($value) {
- if ($value) {
- $value = true;
- } else {
- $value = false;
- }
- $this->error = $value;
+ $this->error = (bool)$value;
}
public function _keepHistory ($value) {
- if ($value) {
- $value = true;
- } else {
- $value = false;
- }
+ $value = intval($value);
+ $value = min($value, 1000000);
+ $value = max($value, -2);
$this->keep_history = $value;
}
public function _nbNotRead ($value) {
@@ -257,11 +250,11 @@ class FreshRSS_Feed extends Minz_Model {
$this->_url ($subscribe_url);
}
- $title = $feed->get_title ();
+ $title = htmlspecialchars(html_only_entity_decode($feed->get_title()), ENT_COMPAT, 'UTF-8');
$this->_name (!is_null ($title) ? $title : $this->url);
- $this->_website ($feed->get_link ());
- $this->_description ($feed->get_description ());
+ $this->_website(html_only_entity_decode($feed->get_link()));
+ $this->_description(html_only_entity_decode($feed->get_description()));
// et on charge les articles du flux
$this->loadEntries ($feed);