diff options
-rw-r--r-- | api/index.php | 3 | ||||
-rw-r--r-- | classes/api.php | 2 | ||||
-rw-r--r-- | classes/handler/public.php | 14 | ||||
-rw-r--r-- | classes/rpc.php | 4 | ||||
-rw-r--r-- | include/functions.php | 11 | ||||
-rw-r--r-- | include/sessions.php | 4 |
6 files changed, 30 insertions, 8 deletions
diff --git a/api/index.php b/api/index.php index 147157946..d248c4f85 100644 --- a/api/index.php +++ b/api/index.php @@ -46,10 +46,9 @@ if ($_REQUEST["sid"]) { session_id($_REQUEST["sid"]); + @session_start(); } - @session_start(); - if (!init_connection($link)) return; $method = strtolower($_REQUEST["op"]); diff --git a/classes/api.php b/classes/api.php index ba0eebb36..cf8b2dcfc 100644 --- a/classes/api.php +++ b/classes/api.php @@ -47,6 +47,8 @@ class API extends Handler { } function login() { + @session_start(); + $login = db_escape_string($this->link, $_REQUEST["user"]); $password = $_REQUEST["password"]; $password_base64 = base64_decode($_REQUEST["password"]); diff --git a/classes/handler/public.php b/classes/handler/public.php index 94938e548..ea70b2fc3 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -349,6 +349,18 @@ class Handler_Public extends Handler { include "rssfuncs.php"; // Update all feeds needing a update. update_daemon_common($this->link, 0, true, false); + + // Update feedbrowser + update_feedbrowser_cache($this->link); + + // Purge orphans and cleanup tags + purge_orphans($this->link); + + cleanup_tags($this->link, 14, 50000); + + global $pluginhost; + $pluginhost->run_hooks($pluginhost::HOOK_UPDATE_TASK, "hook_update_task", $op); + } function sharepopup() { @@ -481,6 +493,8 @@ class Handler_Public extends Handler { function login() { + @session_start(); + $_SESSION["prefs_cache"] = array(); if (!SINGLE_USER_MODE) { diff --git a/classes/rpc.php b/classes/rpc.php index eb241591b..72028759e 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -735,6 +735,10 @@ class RPC extends Handler_Protected { } } + // Purge orphans and cleanup tags + purge_orphans($this->link); + cleanup_tags($this->link, 14, 50000); + if ($num_updated > 0) { print json_encode(array("message" => "UPDATE_COUNTERS", "num_updated" => $num_updated)); diff --git a/include/functions.php b/include/functions.php index f33de076b..f2eeb976b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1436,13 +1436,14 @@ if ($pluginhost) { $feeds = $pluginhost->get_feeds(-1); - foreach ($feeds as $feed) { - $cv = array("id" => PluginHost::pfeed_to_feed_id($feed['id']), - "counter" => $feed['sender']->get_unread($feed['id'])); + if (is_array($feeds)) { + foreach ($feeds as $feed) { + $cv = array("id" => PluginHost::pfeed_to_feed_id($feed['id']), + "counter" => $feed['sender']->get_unread($feed['id'])); - array_push($ret_arr, $cv); + array_push($ret_arr, $cv); + } } - } return $ret_arr; diff --git a/include/sessions.php b/include/sessions.php index 3355ec49e..a83daea82 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -105,6 +105,8 @@ session_set_cookie_params(SESSION_COOKIE_LIFETIME); if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') { - @session_start(); + if ($_COOKIE[$session_name]) { + @session_start(); + } } ?> |