summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-19 15:13:39 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-19 15:13:39 -0400
commit32bd7c839c8538b9f892c11893c140bb70677636 (patch)
tree466504d558d42353663354cf66960a5abee081e5 /lib
parent608b3c7f8aefbb8c7f11d3c0dd548e5a04b4b0b0 (diff)
now saves item's author in db
Diffstat (limited to 'lib')
-rw-r--r--lib/feedmapper.php2
-rw-r--r--lib/itemmapper.php6
-rw-r--r--lib/utils.php6
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/feedmapper.php b/lib/feedmapper.php
index e3d8fa67f..82fff36ec 100644
--- a/lib/feedmapper.php
+++ b/lib/feedmapper.php
@@ -34,7 +34,7 @@ class FeedMapper {
*/
public function fromRow($row){
$url = $row['url'];
- $title = htmlspecialchars_decode($row['title']);
+ $title = $row['title'];
$id = $row['id'];
$feed = new Feed($url, $title, null, $id);
$favicon = $row['favicon_link'];
diff --git a/lib/itemmapper.php b/lib/itemmapper.php
index 661e3cf7a..4a8b569e1 100644
--- a/lib/itemmapper.php
+++ b/lib/itemmapper.php
@@ -186,11 +186,12 @@ class ItemMapper {
if ($itemid == null){
$title = $item->getTitle();
$body = $item->getBody();
+ $author = $item->getAuthor();
$stmt = \OCP\DB::prepare('
INSERT INTO ' . self::tableName .
- '(url, title, body, guid, guid_hash, pub_date, feed_id, status)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+ '(url, title, body, author, guid, guid_hash, pub_date, feed_id, status)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
');
if(empty($title)) {
@@ -209,6 +210,7 @@ class ItemMapper {
$item->getUrl(),
$title,
$body,
+ $author,
$guid,
$guid_hash,
$pub_date,
diff --git a/lib/utils.php b/lib/utils.php
index b3ff3db0c..1632849b6 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -66,9 +66,9 @@ class Utils {
$itemBody = $spitem->get_content();
$item = new Item($itemUrl, $itemTitle, $itemGUID, $itemBody);
- $itemAuthor = $spitem->get_author();
- if ($itemAuthor !== null) {
- $item->setAuthor($itemAuthor->get_name());
+ $spAuthor = $spitem->get_author();
+ if ($spAuthor !== null) {
+ $item->setAuthor($spAuthor->get_name());
}
//date in Item is stored in UNIX timestamp format