diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-21 15:34:50 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-21 15:34:50 -0400 |
commit | 5940e12a707e05aa458e96126da23e8bd8c3fdca (patch) | |
tree | 7c82113409e8e16f800e2732ede61334997c2f6e /lib/itemmapper.php | |
parent | 2a15c85cd9c08af627798c61eced0511b05a1ac3 (diff) |
fix insert query because of NULL exception
Diffstat (limited to 'lib/itemmapper.php')
-rw-r--r-- | lib/itemmapper.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/itemmapper.php b/lib/itemmapper.php index fa6705f69..ed533f31d 100644 --- a/lib/itemmapper.php +++ b/lib/itemmapper.php @@ -58,11 +58,11 @@ class OC_News_ItemMapper { $query = OCP\DB::prepare(' INSERT INTO ' . self::tableName . '(url, title, feedid) - VALUES (?, ?, $feedid) + VALUES (?, ?, ?) '); $title = $item->getTitle(); -echo $title . '<br>'; + if(empty($title)) { $l = OC_L10N::get('news'); $title = $l->t('no title'); @@ -70,8 +70,10 @@ echo $title . '<br>'; $params=array( htmlspecialchars_decode($item->getUrl()), - htmlspecialchars_decode($title) + htmlspecialchars_decode($title), + $feedid ); + $query->execute($params); $itemid = OCP\DB::insertid(self::tableName); |