$login = $this->dbh->escape_string($_REQUEST['login']);
$pass = trim($_REQUEST['pass']); // escaped later
- $rc = subscribe_to_feed($feed, $cat, $login, $pass);
+ $rc = Feeds::subscribe_to_feed($feed, $cat, $login, $pass);
print json_encode(array("result" => $rc));
}
$this->dbh->query("DELETE FROM ttrss_user_entries
WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
- purge_orphans();
+ Article::purge_orphans();
print json_encode(array("message" => "UPDATE_COUNTERS"));
}
"/public.php?op=rss&id=-2&key=" .
get_feed_access_key(-2, false);
- $p = new Publisher(PUBSUBHUBBUB_HUB);
+ $p = new pubsubhubbub\publisher\Publisher(PUBSUBHUBBUB_HUB);
$pubsub_result = $p->publish_update($rss_link);
}
if ($this->dbh->num_rows($result) == 0) {
$result = $this->dbh->query("INSERT INTO ttrss_feeds
(owner_uid,feed_url,title,cat_id,site_url)
- VALUES ('$id','".$_SESSION["uid"]."',
+ VALUES ('".$_SESSION["uid"]."',
'$feed_url', '$title', NULL, '$site_url')");
}
}
$feed_id = $this->dbh->escape_string($_REQUEST['feed_id']);
$is_cat = $this->dbh->escape_string($_REQUEST['is_cat']) == "true";
$mode = $this->dbh->escape_string($_REQUEST['mode']);
+ $search_query = $this->dbh->escape_string($_REQUEST['search_query']);
+ $search_lang = $this->dbh->escape_string($_REQUEST['search_lang']);
- catchup_feed($feed_id, $is_cat, false, false, $mode);
+ Feeds::catchup_feed($feed_id, $is_cat, false, $mode, [$search_query, $search_lang]);
print json_encode(array("message" => "UPDATE_COUNTERS"));
}
}
// Purge orphans and cleanup tags
- purge_orphans();
+ Article::purge_orphans();
//cleanup_tags(14, 50000);
if ($num_updated > 0) {
"/public.php?op=rss&id=-2&key=" .
get_feed_access_key(-2, false);
- $p = new Publisher(PUBSUBHUBBUB_HUB);
+ $p = new pubsubhubbub\publisher\Publisher(PUBSUBHUBBUB_HUB);
/* $pubsub_result = */ $p->publish_update($rss_link);
}
}
function log() {
- $logmsg = $this->dbh->escape_string($_REQUEST['logmsg']);
+ $msg = $this->dbh->escape_string($_REQUEST['msg']);
+ $file = $this->dbh->escape_string(basename($_REQUEST['file']));
+ $line = (int) $_REQUEST['line'];
+ $context = $this->dbh->escape_string($_REQUEST['context']);
- if ($logmsg) {
+ if ($msg) {
Logger::get()->log_error(E_USER_WARNING,
- $logmsg, '[client-js]', 0, false);
- }
+ $msg, 'client-js:' . $file, $line, $context);
- echo json_encode(array("message" => "HOST_ERROR_LOGGED"));
+ echo json_encode(array("message" => "HOST_ERROR_LOGGED"));
+ } else {
+ echo json_encode(array("error" => "MESSAGE_NOT_FOUND"));
+ }
}
-}
-?>
+}
\ No newline at end of file