article: unify naming

This commit is contained in:
Andrew Dolgov 2021-02-15 15:52:28 +03:00
parent 020f062a76
commit 257efb43c6
16 changed files with 62 additions and 89 deletions

View File

@ -316,7 +316,7 @@ class API extends Handler {
"guid" => $line["guid"], "guid" => $line["guid"],
"title" => $line["title"], "title" => $line["title"],
"link" => $line["link"], "link" => $line["link"],
"labels" => Article::get_article_labels($line['id']), "labels" => Article::_get_labels($line['id']),
"unread" => self::param_to_bool($line["unread"]), "unread" => self::param_to_bool($line["unread"]),
"marked" => self::param_to_bool($line["marked"]), "marked" => self::param_to_bool($line["marked"]),
"published" => self::param_to_bool($line["published"]), "published" => self::param_to_bool($line["published"]),
@ -324,7 +324,7 @@ class API extends Handler {
"author" => $line["author"], "author" => $line["author"],
"updated" => (int) strtotime($line["updated"]), "updated" => (int) strtotime($line["updated"]),
"feed_id" => $line["feed_id"], "feed_id" => $line["feed_id"],
"attachments" => Article::get_enclosures($line['id']), "attachments" => Article::_get_enclosures($line['id']),
"score" => (int)$line["score"], "score" => (int)$line["score"],
"feed_title" => $line["feed_title"], "feed_title" => $line["feed_title"],
"note" => $line["note"], "note" => $line["note"],
@ -417,7 +417,7 @@ class API extends Handler {
$sth->execute([$_SESSION['uid']]); $sth->execute([$_SESSION['uid']]);
if ($article_id) if ($article_id)
$article_labels = Article::get_article_labels($article_id); $article_labels = Article::_get_labels($article_id);
else else
$article_labels = array(); $article_labels = array();
@ -489,7 +489,7 @@ class API extends Handler {
$url = strip_tags(clean($_REQUEST["url"])); $url = strip_tags(clean($_REQUEST["url"]));
$content = strip_tags(clean($_REQUEST["content"])); $content = strip_tags(clean($_REQUEST["content"]));
if (Article::create_published_article($title, $url, $content, "", $_SESSION["uid"])) { if (Article::_create_published_article($title, $url, $content, "", $_SESSION["uid"])) {
$this->wrap(self::STATUS_OK, array("status" => 'OK')); $this->wrap(self::STATUS_OK, array("status" => 'OK'));
} else { } else {
$this->wrap(self::STATUS_ERR, array("error" => 'Publishing failed')); $this->wrap(self::STATUS_ERR, array("error" => 'Publishing failed'));
@ -718,7 +718,7 @@ class API extends Handler {
} }
} }
if (!is_array($labels)) $labels = Article::get_article_labels($line["id"]); if (!is_array($labels)) $labels = Article::_get_labels($line["id"]);
$headline_row = array( $headline_row = array(
"id" => (int)$line["id"], "id" => (int)$line["id"],
@ -734,7 +734,7 @@ class API extends Handler {
"tags" => $tags, "tags" => $tags,
); );
$enclosures = Article::get_enclosures($line['id']); $enclosures = Article::_get_enclosures($line['id']);
if ($include_attachments) if ($include_attachments)
$headline_row['attachments'] = $enclosures; $headline_row['attachments'] = $enclosures;
@ -775,7 +775,7 @@ class API extends Handler {
if ($show_content) { if ($show_content) {
$hook_object = ["headline" => &$headline_row]; $hook_object = ["headline" => &$headline_row];
list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, list ($flavor_image, $flavor_stream, $flavor_kind) = Article::_get_image($enclosures,
$line["content"], // unsanitized $line["content"], // unsanitized
$line["site_url"]); $line["site_url"]);

View File

@ -27,7 +27,7 @@ class Article extends Handler_Protected {
} }
} }
static function create_published_article($title, $url, $content, $labels_str, static function _create_published_article($title, $url, $content, $labels_str,
$owner_uid) { $owner_uid) {
$guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid); // include owner_uid to prevent global GUID clash $guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid); // include owner_uid to prevent global GUID clash
@ -165,7 +165,7 @@ class Article extends Handler_Protected {
$id = (int) clean($_REQUEST['id'] ?? 0); $id = (int) clean($_REQUEST['id'] ?? 0);
print json_encode(["id" => $id, print json_encode(["id" => $id,
"tags" => self::get_article_tags($id)]); "tags" => self::_get_tags($id)]);
} }
function setScore() { function setScore() {
@ -248,8 +248,8 @@ class Article extends Handler_Protected {
$this->pdo->commit(); $this->pdo->commit();
$tags = self::get_article_tags($id); $tags = self::_get_tags($id);
$tags_str = $this->format_tags_string($tags); $tags_str = $this->_format_tags_html($tags);
$tags_str_full = join(", ", $tags); $tags_str_full = join(", ", $tags);
if (!$tags_str_full) $tags_str_full = __("no tags"); if (!$tags_str_full) $tags_str_full = __("no tags");
@ -277,14 +277,14 @@ class Article extends Handler_Protected {
} }
function assigntolabel() { function assigntolabel() {
return $this->labelops(true); return $this->_label_ops(true);
} }
function removefromlabel() { function removefromlabel() {
return $this->labelops(false); return $this->_label_ops(false);
} }
private function labelops($assign) { private function _label_ops($assign) {
$reply = array(); $reply = array();
$ids = explode(",", clean($_REQUEST["ids"])); $ids = explode(",", clean($_REQUEST["ids"]));
@ -303,10 +303,10 @@ class Article extends Handler_Protected {
else else
Labels::remove_article($id, $label, $_SESSION["uid"]); Labels::remove_article($id, $label, $_SESSION["uid"]);
$labels = $this->get_article_labels($id, $_SESSION["uid"]); $labels = $this->_get_labels($id, $_SESSION["uid"]);
array_push($reply["info-for-headlines"], array_push($reply["info-for-headlines"],
array("id" => $id, "labels" => $this->format_article_labels($labels))); array("id" => $id, "labels" => $this->_format_labels_html($labels)));
} }
} }
@ -316,24 +316,12 @@ class Article extends Handler_Protected {
print json_encode($reply); print json_encode($reply);
} }
function getArticleFeed($id) { static function _format_enclosures($id,
$sth = $this->pdo->prepare("SELECT feed_id FROM ttrss_user_entries
WHERE ref_id = ? AND owner_uid = ?");
$sth->execute([$id, $_SESSION['uid']]);
if ($row = $sth->fetch()) {
return $row["feed_id"];
} else {
return 0;
}
}
static function format_enclosures($id,
$always_display_enclosures, $always_display_enclosures,
$article_content, $article_content,
$hide_images = false) { $hide_images = false) {
$enclosures = self::get_enclosures($id); $enclosures = self::_get_enclosures($id);
$rv = []; $rv = [];
$enclosures_formatted = ""; $enclosures_formatted = "";
@ -389,7 +377,7 @@ class Article extends Handler_Protected {
return $rv; return $rv;
} }
static function get_article_tags($id, $owner_uid = 0, $tag_cache = false) { static function _get_tags($id, $owner_uid = 0, $tag_cache = false) {
$a_id = $id; $a_id = $id;
@ -439,7 +427,7 @@ class Article extends Handler_Protected {
return $tags; return $tags;
} }
static function format_tags_string($tags) { static function _format_tags_html($tags) {
if (!is_array($tags) || count($tags) == 0) { if (!is_array($tags) || count($tags) == 0) {
return __("no tags"); return __("no tags");
} else { } else {
@ -459,7 +447,7 @@ class Article extends Handler_Protected {
} }
} }
static function format_article_labels($labels) { static function _format_labels_html($labels) {
if (!is_array($labels)) return ''; if (!is_array($labels)) return '';
@ -475,8 +463,7 @@ class Article extends Handler_Protected {
} }
static function format_article_note($id, $note, $allow_edit = true) { static function _format_note_html($id, $note, $allow_edit = true) {
if ($allow_edit) { if ($allow_edit) {
$onclick = "onclick='Plugins.Note.edit($id)'"; $onclick = "onclick='Plugins.Note.edit($id)'";
$note_class = 'editable'; $note_class = 'editable';
@ -491,7 +478,7 @@ class Article extends Handler_Protected {
</div>"; </div>";
} }
function get_metadata_by_id() { function getmetadatabyid() {
$id = clean($_REQUEST['id']); $id = clean($_REQUEST['id']);
$sth = $this->pdo->prepare("SELECT link, title FROM ttrss_entries, ttrss_user_entries $sth = $this->pdo->prepare("SELECT link, title FROM ttrss_entries, ttrss_user_entries
@ -506,7 +493,7 @@ class Article extends Handler_Protected {
} }
} }
static function get_enclosures($id) { static function _get_enclosures($id) {
$pdo = Db::pdo(); $pdo = Db::pdo();
@ -530,7 +517,7 @@ class Article extends Handler_Protected {
return $rv; return $rv;
} }
static function purge_orphans() { static function _purge_orphans() {
// purge orphaned posts in main content table // purge orphaned posts in main content table
@ -549,7 +536,7 @@ class Article extends Handler_Protected {
} }
} }
static function catchupArticlesById($ids, $cmode, $owner_uid = false) { static function _catchup_by_id($ids, $cmode, $owner_uid = false) {
if (!$owner_uid) $owner_uid = $_SESSION["uid"]; if (!$owner_uid) $owner_uid = $_SESSION["uid"];
@ -574,21 +561,7 @@ class Article extends Handler_Protected {
$sth->execute(array_merge($ids, [$owner_uid])); $sth->execute(array_merge($ids, [$owner_uid]));
} }
static function getLastArticleId() { static function _get_labels($id, $owner_uid = false) {
$pdo = Db::pdo();
$sth = $pdo->prepare("SELECT ref_id AS id FROM ttrss_user_entries
WHERE owner_uid = ? ORDER BY ref_id DESC LIMIT 1");
$sth->execute([$_SESSION['uid']]);
if ($row = $sth->fetch()) {
return $row['id'];
} else {
return -1;
}
}
static function get_article_labels($id, $owner_uid = false) {
$rv = array(); $rv = array();
if (!$owner_uid) $owner_uid = $_SESSION["uid"]; if (!$owner_uid) $owner_uid = $_SESSION["uid"];
@ -635,7 +608,7 @@ class Article extends Handler_Protected {
return $rv; return $rv;
} }
static function get_article_image($enclosures, $content, $site_url) { static function _get_image($enclosures, $content, $site_url) {
$article_image = ""; $article_image = "";
$article_stream = ""; $article_stream = "";

View File

@ -68,7 +68,7 @@ class Digest
if ($rc && $do_catchup) { if ($rc && $do_catchup) {
Debug::log("Marking affected articles as read..."); Debug::log("Marking affected articles as read...");
Article::catchupArticlesById($affected_ids, 0, $line["id"]); Article::_catchup_by_id($affected_ids, 0, $line["id"]);
} }
} else { } else {
Debug::log("No headlines"); Debug::log("No headlines");
@ -164,7 +164,7 @@ class Digest
$line['feed_title'] = $line['cat_title'] . " / " . $line['feed_title']; $line['feed_title'] = $line['cat_title'] . " / " . $line['feed_title'];
} }
$article_labels = Article::get_article_labels($line["ref_id"], $user_id); $article_labels = Article::_get_labels($line["ref_id"], $user_id);
$article_labels_formatted = ""; $article_labels_formatted = "";
if (is_array($article_labels) && count($article_labels) > 0) { if (is_array($article_labels) && count($article_labels) > 0) {

View File

@ -9,7 +9,7 @@ abstract class FeedItem {
abstract function get_comments_url(); abstract function get_comments_url();
abstract function get_comments_count(); abstract function get_comments_count();
abstract function get_categories(); abstract function get_categories();
abstract function get_enclosures(); abstract function _get_enclosures();
abstract function get_author(); abstract function get_author();
abstract function get_language(); abstract function get_language();
} }

View File

@ -119,7 +119,7 @@ class FeedItem_Atom extends FeedItem_Common {
return $this->normalize_categories($cats); return $this->normalize_categories($cats);
} }
function get_enclosures() { function _get_enclosures() {
$links = $this->elem->getElementsByTagName("link"); $links = $this->elem->getElementsByTagName("link");
$encs = array(); $encs = array();
@ -138,7 +138,7 @@ class FeedItem_Atom extends FeedItem_Common {
} }
} }
$encs = array_merge($encs, parent::get_enclosures()); $encs = array_merge($encs, parent::_get_enclosures());
return $encs; return $encs;
} }

View File

@ -78,7 +78,7 @@ abstract class FeedItem_Common extends FeedItem {
} }
// this is common for both Atom and RSS types and deals with various media: elements // this is common for both Atom and RSS types and deals with various media: elements
function get_enclosures() { function _get_enclosures() {
$encs = []; $encs = [];
$enclosures = $this->xpath->query("media:content", $this->elem); $enclosures = $this->xpath->query("media:content", $this->elem);

View File

@ -112,7 +112,7 @@ class FeedItem_RSS extends FeedItem_Common {
return $this->normalize_categories($cats); return $this->normalize_categories($cats);
} }
function get_enclosures() { function _get_enclosures() {
$enclosures = $this->elem->getElementsByTagName("enclosure"); $enclosures = $this->elem->getElementsByTagName("enclosure");
$encs = array(); $encs = array();
@ -129,7 +129,7 @@ class FeedItem_RSS extends FeedItem_Common {
array_push($encs, $enc); array_push($encs, $enc);
} }
$encs = array_merge($encs, parent::get_enclosures()); $encs = array_merge($encs, parent::_get_enclosures());
return $encs; return $encs;
} }

View File

@ -214,10 +214,10 @@ class Feeds extends Handler_Protected {
} }
} }
if (!is_array($labels)) $labels = Article::get_article_labels($id); if (!is_array($labels)) $labels = Article::_get_labels($id);
$labels_str = "<span class=\"HLLCTR-$id\">"; $labels_str = "<span class=\"HLLCTR-$id\">";
$labels_str .= Article::format_article_labels($labels); $labels_str .= Article::_format_labels_html($labels);
$labels_str .= "</span>"; $labels_str .= "</span>";
$line["labels"] = $labels_str; $line["labels"] = $labels_str;
@ -265,7 +265,7 @@ class Feeds extends Handler_Protected {
$this->_mark_timestamp(" disk_cache_rewrite"); $this->_mark_timestamp(" disk_cache_rewrite");
if ($line['note']) if ($line['note'])
$line['note'] = Article::format_article_note($id, $line['note']); $line['note'] = Article::_format_note_html($id, $line['note']);
else else
$line['note'] = ""; $line['note'] = "";
@ -283,7 +283,7 @@ class Feeds extends Handler_Protected {
$this->_mark_timestamp(" pre-enclosures"); $this->_mark_timestamp(" pre-enclosures");
$line["enclosures"] = Article::format_enclosures($id, $line["enclosures"] = Article::_format_enclosures($id,
$line["always_display_enclosures"], $line["always_display_enclosures"],
$line["content"], $line["content"],
$line["hide_images"]); $line["hide_images"]);
@ -303,7 +303,7 @@ class Feeds extends Handler_Protected {
else else
$tags = false; $tags = false;
$line["tags_str"] = Article::format_tags_string($tags); $line["tags_str"] = Article::_format_tags_html($tags);
$this->_mark_timestamp(" tags"); $this->_mark_timestamp(" tags");

View File

@ -82,7 +82,7 @@ class Handler_Public extends Handler {
while ($line = $result->fetch()) { while ($line = $result->fetch()) {
$line["content_preview"] = Sanitizer::sanitize(truncate_string(strip_tags($line["content"]), 100, '...')); $line["content_preview"] = Sanitizer::sanitize(truncate_string(strip_tags($line["content"]), 100, '...'));
$line["tags"] = Article::get_article_tags($line["id"], $owner_uid); $line["tags"] = Article::_get_tags($line["id"], $owner_uid);
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_QUERY_HEADLINES, PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_QUERY_HEADLINES,
function ($result) use (&$line) { function ($result) use (&$line) {
@ -131,7 +131,7 @@ class Handler_Public extends Handler {
$tpl->addBlock('category'); $tpl->addBlock('category');
} }
$enclosures = Article::get_enclosures($line["id"]); $enclosures = Article::_get_enclosures($line["id"]);
if (count($enclosures) > 0) { if (count($enclosures) > 0) {
foreach ($enclosures as $e) { foreach ($enclosures as $e) {
@ -151,7 +151,7 @@ class Handler_Public extends Handler {
$tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', null, true); $tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', null, true);
} }
list ($og_image, $og_stream) = Article::get_article_image($enclosures, $line['content'], $feed_site_url); list ($og_image, $og_stream) = Article::_get_image($enclosures, $line['content'], $feed_site_url);
$tpl->setVariable('ARTICLE_OG_IMAGE', $og_image, true); $tpl->setVariable('ARTICLE_OG_IMAGE', $og_image, true);
@ -184,7 +184,7 @@ class Handler_Public extends Handler {
while ($line = $result->fetch()) { while ($line = $result->fetch()) {
$line["content_preview"] = Sanitizer::sanitize(truncate_string(strip_tags($line["content_preview"]), 100, '...')); $line["content_preview"] = Sanitizer::sanitize(truncate_string(strip_tags($line["content_preview"]), 100, '...'));
$line["tags"] = Article::get_article_tags($line["id"], $owner_uid); $line["tags"] = Article::_get_tags($line["id"], $owner_uid);
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_QUERY_HEADLINES, PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_QUERY_HEADLINES,
function ($result) use (&$line) { function ($result) use (&$line) {
@ -218,7 +218,7 @@ class Handler_Public extends Handler {
} }
} }
$enclosures = Article::get_enclosures($line["id"]); $enclosures = Article::_get_enclosures($line["id"]);
if (count($enclosures) > 0) { if (count($enclosures) > 0) {
$article['enclosures'] = array(); $article['enclosures'] = array();
@ -341,7 +341,7 @@ class Handler_Public extends Handler {
if ($line = $sth->fetch()) { if ($line = $sth->fetch()) {
$line["tags"] = Article::get_article_tags($id, $owner_uid, $line["tag_cache"]); $line["tags"] = Article::_get_tags($id, $owner_uid, $line["tag_cache"]);
unset($line["tag_cache"]); unset($line["tag_cache"]);
$line["content"] = Sanitizer::sanitize($line["content"], $line["content"] = Sanitizer::sanitize($line["content"],
@ -390,8 +390,8 @@ class Handler_Public extends Handler {
$rv .= "</head>"; $rv .= "</head>";
$enclosures = Article::get_enclosures($line["id"]); $enclosures = Article::_get_enclosures($line["id"]);
list ($og_image, $og_stream) = Article::get_article_image($enclosures, $line['content'], $line["site_url"]); list ($og_image, $og_stream) = Article::_get_image($enclosures, $line['content'], $line["site_url"]);
if ($og_image) { if ($og_image) {
$rv .= "<meta property='og:image' content=\"" . htmlspecialchars($og_image) . "\"/>"; $rv .= "<meta property='og:image' content=\"" . htmlspecialchars($og_image) . "\"/>";
@ -573,7 +573,7 @@ class Handler_Public extends Handler {
$content = strip_tags(clean($_REQUEST["content"])); $content = strip_tags(clean($_REQUEST["content"]));
$labels = strip_tags(clean($_REQUEST["labels"])); $labels = strip_tags(clean($_REQUEST["labels"]));
Article::create_published_article($title, $url, $content, $labels, Article::_create_published_article($title, $url, $content, $labels,
$_SESSION["uid"]); $_SESSION["uid"]);
print "<script type='text/javascript'>"; print "<script type='text/javascript'>";

View File

@ -60,7 +60,7 @@ class Labels
self::clear_cache($id); self::clear_cache($id);
if (!$labels) if (!$labels)
$labels = Article::get_article_labels($id); $labels = Article::_get_labels($id);
$labels = json_encode($labels); $labels = json_encode($labels);

View File

@ -47,7 +47,7 @@ class PluginHost {
const HOOK_QUERY_HEADLINES = "hook_query_headlines"; // hook_query_headlines($row) (byref) const HOOK_QUERY_HEADLINES = "hook_query_headlines"; // hook_query_headlines($row) (byref)
const HOOK_HOUSE_KEEPING = "hook_house_keeping"; //*1 // GLOBAL: hook_house_keeping() const HOOK_HOUSE_KEEPING = "hook_house_keeping"; //*1 // GLOBAL: hook_house_keeping()
const HOOK_SEARCH = "hook_search"; // hook_search($query) const HOOK_SEARCH = "hook_search"; // hook_search($query)
const HOOK_FORMAT_ENCLOSURES = "hook_format_enclosures"; // hook_format_enclosures($rv, $result, $id, $always_display_enclosures, $article_content, $hide_images) (byref) const HOOK_FORMAT_ENCLOSURES = "hook_format_enclosures"; // hook__format_enclosures($rv, $result, $id, $always_display_enclosures, $article_content, $hide_images) (byref)
const HOOK_SUBSCRIBE_FEED = "hook_subscribe_feed"; // hook_subscribe_feed($contents, $url, $auth_login, $auth_pass) (byref) const HOOK_SUBSCRIBE_FEED = "hook_subscribe_feed"; // hook_subscribe_feed($contents, $url, $auth_login, $auth_pass) (byref)
const HOOK_HEADLINES_BEFORE = "hook_headlines_before"; // hook_headlines_before($feed, $is_cat, $qfh_ret) const HOOK_HEADLINES_BEFORE = "hook_headlines_before"; // hook_headlines_before($feed, $is_cat, $qfh_ret)
const HOOK_RENDER_ENCLOSURE = "hook_render_enclosure"; // hook_render_enclosure($entry, $hide_images) const HOOK_RENDER_ENCLOSURE = "hook_render_enclosure"; // hook_render_enclosure($entry, $hide_images)

View File

@ -119,7 +119,7 @@ class RPC extends Handler_Protected {
WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?");
$sth->execute(array_merge($ids, [$_SESSION['uid']])); $sth->execute(array_merge($ids, [$_SESSION['uid']]));
Article::purge_orphans(); Article::_purge_orphans();
print json_encode(array("message" => "UPDATE_COUNTERS")); print json_encode(array("message" => "UPDATE_COUNTERS"));
} }
@ -156,7 +156,7 @@ class RPC extends Handler_Protected {
$ids = explode(",", clean($_REQUEST["ids"])); $ids = explode(",", clean($_REQUEST["ids"]));
$cmode = (int)clean($_REQUEST["cmode"]); $cmode = (int)clean($_REQUEST["cmode"]);
Article::catchupArticlesById($ids, $cmode); Article::_catchup_by_id($ids, $cmode);
print json_encode(array("message" => "UPDATE_COUNTERS", "ids" => $ids)); print json_encode(array("message" => "UPDATE_COUNTERS", "ids" => $ids));
} }
@ -310,7 +310,7 @@ class RPC extends Handler_Protected {
} }
// Purge orphans and cleanup tags // Purge orphans and cleanup tags
Article::purge_orphans(); Article::_purge_orphans();
//cleanup_tags(14, 50000); //cleanup_tags(14, 50000);
if ($num_updated > 0) { if ($num_updated > 0) {

View File

@ -723,9 +723,9 @@ class RSSUtils {
if ($row = $sth->fetch()) { if ($row = $sth->fetch()) {
$base_entry_id = $row["id"]; $base_entry_id = $row["id"];
$entry_stored_hash = $row["content_hash"]; $entry_stored_hash = $row["content_hash"];
$article_labels = Article::get_article_labels($base_entry_id, $owner_uid); $article_labels = Article::_get_labels($base_entry_id, $owner_uid);
$existing_tags = Article::get_article_tags($base_entry_id, $owner_uid); $existing_tags = Article::_get_tags($base_entry_id, $owner_uid);
$entry_tags = array_unique(array_merge($entry_tags, $existing_tags)); $entry_tags = array_unique(array_merge($entry_tags, $existing_tags));
} else { } else {
$base_entry_id = false; $base_entry_id = false;
@ -739,7 +739,7 @@ class RSSUtils {
$enclosures = array(); $enclosures = array();
$encs = $item->get_enclosures(); $encs = $item->_get_enclosures();
if (is_array($encs)) { if (is_array($encs)) {
foreach ($encs as $e) { foreach ($encs as $e) {
@ -1636,7 +1636,7 @@ class RSSUtils {
self::cleanup_feed_icons(); self::cleanup_feed_icons();
self::disable_failed_feeds(); self::disable_failed_feeds();
Article::purge_orphans(); Article::_purge_orphans();
self::cleanup_counters_cache(); self::cleanup_counters_cache();
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING); PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING);

View File

@ -123,7 +123,7 @@ const Article = {
Article.setActive(0); Article.setActive(0);
}, },
displayUrl: function (id) { displayUrl: function (id) {
const query = {op: "article", method: "get_metadata_by_id", id: id}; const query = {op: "article", method: "getmetadatabyid", id: id};
xhrJson("backend.php", query, (reply) => { xhrJson("backend.php", query, (reply) => {
if (reply && reply.link) { if (reply && reply.link) {

View File

@ -332,7 +332,7 @@ const Filters = {
} else { } else {
const query = {op: "article", method: "get_metadata_by_id", id: Article.getActive()}; const query = {op: "article", method: "getmetadatabyid", id: Article.getActive()};
xhrPost("backend.php", query, (transport) => { xhrPost("backend.php", query, (transport) => {
const reply = JSON.parse(transport.responseText); const reply = JSON.parse(transport.responseText);

View File

@ -65,7 +65,7 @@ class Note extends Plugin {
WHERE ref_id = ? AND owner_uid = ?"); WHERE ref_id = ? AND owner_uid = ?");
$sth->execute([$note, $id, $_SESSION['uid']]); $sth->execute([$note, $id, $_SESSION['uid']]);
$formatted_note = Article::format_article_note($id, $note); $formatted_note = Article::_format_note_html($id, $note);
print json_encode(array("note" => $formatted_note, print json_encode(array("note" => $formatted_note,
"raw_length" => mb_strlen($note))); "raw_length" => mb_strlen($note)));