aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorEric Priou aka erixtekila <erixtekila@gmail.com>2015-02-05 14:19:03 +0100
committerEric Priou aka erixtekila <erixtekila@gmail.com>2015-02-05 14:19:03 +0100
commitfde4cf0616e68d7b94f0991c1fcb434de4567c17 (patch)
treeac5f93df42d4e4c1fe2c43449bc588adf56d351b /inc/poche/Poche.class.php
parent5e26c9102450cdf4e635fc401b88e293402fca25 (diff)
downloadwallabag-fde4cf0616e68d7b94f0991c1fcb434de4567c17.tar.gz
wallabag-fde4cf0616e68d7b94f0991c1fcb434de4567c17.tar.zst
wallabag-fde4cf0616e68d7b94f0991c1fcb434de4567c17.zip
Fix fetched entries when localized
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-xinc/poche/Poche.class.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index a601f0a8..d096de91 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -740,17 +740,23 @@ class Poche
740 $purifier = $this->_getPurifier(); 740 $purifier = $this->_getPurifier();
741 foreach($items as $item) { 741 foreach($items as $item) {
742 $url = new Url(base64_encode($item['url'])); 742 $url = new Url(base64_encode($item['url']));
743 Tools::logm('Fetching article ' . $item['id']); 743 if( $url->isCorrect() )
744 $content = Tools::getPageContent($url); 744 {
745 $title = (($content['rss']['channel']['item']['title'] != '') ? $content['rss']['channel']['item']['title'] : _('Untitled')); 745 Tools::logm('Fetching article ' . $item['id']);
746 $body = (($content['rss']['channel']['item']['description'] != '') ? $content['rss']['channel']['item']['description'] : _('Undefined')); 746 $content = Tools::getPageContent($url);
747 747 $title = (($content['rss']['channel']['item']['title'] != '') ? $content['rss']['channel']['item']['title'] : _('Untitled'));
748 // clean content to prevent xss attack 748 $body = (($content['rss']['channel']['item']['description'] != '') ? $content['rss']['channel']['item']['description'] : _('Undefined'));
749 749
750 $title = $purifier->purify($title); 750 // clean content to prevent xss attack
751 $body = $purifier->purify($body); 751
752 $this->store->updateContentAndTitle($item['id'], $title, $body, $this->user->getId()); 752 $title = $purifier->purify($title);
753 Tools::logm('Article ' . $item['id'] . ' updated.'); 753 $body = $purifier->purify($body);
754 $this->store->updateContentAndTitle($item['id'], $title, $body, $this->user->getId());
755 Tools::logm('Article ' . $item['id'] . ' updated.');
756 } else
757 {
758 Tools::logm('Unvalid URL (' . $item['url'] .') to fetch for article ' . $item['id']);
759 }
754 } 760 }
755 } 761 }
756 } 762 }