- if ($this->dbh->num_rows($result) != 0) {
-
- while ($line = $this->dbh->fetch_assoc($result)) {
-
- $attachments = get_article_enclosures($line['id']);
-
- $article = array(
- "id" => $line["id"],
- "title" => $line["title"],
- "link" => $line["link"],
- "labels" => get_article_labels($line['id']),
- "unread" => sql_bool_to_bool($line["unread"]),
- "marked" => sql_bool_to_bool($line["marked"]),
- "published" => sql_bool_to_bool($line["published"]),
- "comments" => $line["comments"],
- "author" => $line["author"],
- "updated" => (int) strtotime($line["updated"]),
- "content" => $line["content"],
- "feed_id" => $line["feed_id"],
- "attachments" => $attachments,
- "score" => (int)$line["score"],
- "feed_title" => $line["feed_title"],
- "note" => $line["note"],
- "lang" => $line["lang"]
- );
+ while ($line = $sth->fetch()) {
+
+ $attachments = Article::get_article_enclosures($line['id']);
+
+ $article = array(
+ "id" => $line["id"],
+ "guid" => $line["guid"],
+ "title" => $line["title"],
+ "link" => $line["link"],
+ "labels" => Article::get_article_labels($line['id']),
+ "unread" => API::param_to_bool($line["unread"]),
+ "marked" => API::param_to_bool($line["marked"]),
+ "published" => API::param_to_bool($line["published"]),
+ "comments" => $line["comments"],
+ "author" => $line["author"],
+ "updated" => (int) strtotime($line["updated"]),
+ "feed_id" => $line["feed_id"],
+ "attachments" => $attachments,
+ "score" => (int)$line["score"],
+ "feed_title" => $line["feed_title"],
+ "note" => $line["note"],
+ "lang" => $line["lang"]
+ );
+
+ if ($sanitize_content) {
+ $article["content"] = sanitize(
+ $line["content"],
+ API::param_to_bool($line['hide_images']),
+ false, $line["site_url"], false, $line["id"]);
+ } else {
+ $article["content"] = $line["content"];
+ }