Commit d1fd9e67 authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.5.11+dfsg

parent aa60261f
......@@ -21,7 +21,9 @@
chdir("..");
if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT) {
if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT &&
function_exists("ob_gzhandler")) {
ob_start("ob_gzhandler");
}
......
......@@ -56,7 +56,7 @@
header("Content-Type: text/plain; charset=utf-8");
if (ENABLE_GZIP_OUTPUT) {
if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
ob_start("ob_gzhandler");
}
......
......@@ -2,7 +2,7 @@
class API extends Handler {
const API_LEVEL = 2;
const API_LEVEL = 3;
const STATUS_OK = 0;
const STATUS_ERR = 1;
......@@ -126,7 +126,7 @@ class API extends Handler {
// TODO do not return empty categories, return Uncategorized and standard virtual cats
$result = db_query($this->link, "SELECT
id, title FROM ttrss_feed_categories
id, title, order_id FROM ttrss_feed_categories
WHERE owner_uid = " .
$_SESSION["uid"]);
......@@ -138,7 +138,9 @@ class API extends Handler {
if ($unread || !$unread_only) {
array_push($cats, array("id" => $line["id"],
"title" => $line["title"],
"unread" => $unread));
"unread" => $unread,
"order_id" => (int) $line["order_id"],
));
}
}
......
......@@ -177,28 +177,11 @@ class Feeds extends Protected_Handler {
$method_split = explode(":", $method);
/* if ($method == "CatchupSelected") {
$ids = explode(",", db_escape_string($_REQUEST["ids"]));
$cmode = sprintf("%d", $_REQUEST["cmode"]);
catchupArticlesById($this->link, $ids, $cmode);
} */
if ($method == "ForceUpdate" && $feed && is_numeric($feed) > 0) {
include "rssfuncs.php";
update_rss_feed($this->link, $feed, true);
}
if ($method == "MarkAllRead") {
catchup_feed($this->link, $feed, $cat_view);
if (get_pref($this->link, 'ON_CATCHUP_SHOW_NEXT_FEED')) {
if ($next_unread_feed) {
$feed = $next_unread_feed;
}
}
}
if ($method_split[0] == "MarkAllReadGR") {
catchup_feed($this->link, $method_split[1], false);
}
......@@ -443,7 +426,7 @@ class Feeds extends Protected_Handler {
$cur_feed_title = htmlspecialchars($cur_feed_title);
$vf_catchup_link = "(<a onclick='javascript:catchupFeedInGroup($feed_id);' href='#'>".__('mark as read')."</a>)";
$vf_catchup_link = "(<a onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark as read')."</a>)";
$reply['content'] .= "<div class='cdmFeedTitle'>".
"<div style=\"float : right\">$feed_icon_img</div>".
......
......@@ -3,7 +3,7 @@ class Pref_Feeds extends Protected_Handler {
function csrf_ignore($method) {
$csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed",
"savefeedorder");
"savefeedorder", "uploadicon");
return array_search($method, $csrf_ignored) !== false;
}
......@@ -45,6 +45,7 @@ class Pref_Feeds extends Protected_Handler {
$root['type'] = 'category';
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
$show_empty_cats = get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
$result = db_query($this->link, "SELECT id, title FROM ttrss_feed_categories
WHERE owner_uid = " . $_SESSION["uid"] . " ORDER BY order_id, title");
......@@ -80,7 +81,7 @@ class Pref_Feeds extends Protected_Handler {
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
if (count($cat['items']) > 0)
if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
......@@ -118,7 +119,7 @@ class Pref_Feeds extends Protected_Handler {
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
if (count($cat['items']) > 0)
if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
......@@ -170,6 +171,11 @@ class Pref_Feeds extends Protected_Handler {
return;
}
function togglehiddenfeedcats() {
set_pref($this->link, '_PREFS_SHOW_EMPTY_CATS',
(get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS') ? 'false' : 'true'));
}
function savefeedorder() {
$data = json_decode($_POST['payload'], true);
......@@ -799,31 +805,31 @@ class Pref_Feeds extends Protected_Handler {
break;
case "private":
$qpart = "private = '$private'";
$qpart = "private = $private";
break;
case "include_in_digest":
$qpart = "include_in_digest = '$include_in_digest'";
$qpart = "include_in_digest = $include_in_digest";
break;
case "always_display_enclosures":
$qpart = "always_display_enclosures = '$always_display_enclosures'";
$qpart = "always_display_enclosures = $always_display_enclosures";
break;
case "mark_unread_on_update":
$qpart = "mark_unread_on_update = '$mark_unread_on_update'";
$qpart = "mark_unread_on_update = $mark_unread_on_update";
break;
case "update_on_checksum_change":
$qpart = "update_on_checksum_change = '$update_on_checksum_change'";
$qpart = "update_on_checksum_change = $update_on_checksum_change";
break;
case "cache_images":
$qpart = "cache_images = '$cache_images'";
$qpart = "cache_images = $cache_images";
break;
case "rtl_content":
$qpart = "rtl_content = '$rtl_content'";
$qpart = "rtl_content = $rtl_content";
break;
case "update_method":
......@@ -992,11 +998,12 @@ class Pref_Feeds extends Protected_Handler {
$auth_pass = db_escape_string(trim($_POST["auth_pass"]));
if ($p_from != 'tt-rss') {
header("Content-Type: text/html");
header('Content-Type: text/html; charset=utf-8');
print "<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
</head>
<body>
<img class=\"floatingLogo\" src=\"images/ttrss_logo.png\"
......@@ -1020,7 +1027,7 @@ class Pref_Feeds extends Protected_Handler {
print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
break;
case 4:
print_notice("Multiple feed URLs found.");
print_notice(__("Multiple feed URLs found."));
$feed_urls = get_feeds_from_html($feed_url);
break;
......@@ -1327,6 +1334,8 @@ class Pref_Feeds extends Protected_Handler {
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"editFeedCats()\"
dojoType=\"dijit.MenuItem\">".__('Edit categories')."</div>";
print "<div onclick=\"toggleHiddenFeedCats()\"
dojoType=\"dijit.MenuItem\">".__('(Un)hide empty categories')."</div>";
print "<div onclick=\"resetCatOrder()\"
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "</div></div>";
......@@ -1492,7 +1501,7 @@ class Pref_Feeds extends Protected_Handler {
$bm_subscribe_url = str_replace('%s', '', add_feed_url());
$confirm_str = __('Subscribe to %s in Tiny Tiny RSS?');
$confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?'));
$bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}");
......
......@@ -160,60 +160,61 @@ class Pref_Prefs extends Protected_Handler {
"SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
if (!SINGLE_USER_MODE) {
$_SESSION["prefs_op_result"] = "";
$_SESSION["prefs_op_result"] = "";
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data / Authentication')."\">";
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data / Authentication')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Saving data...', true);
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Saving data...', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_callback2(transport);
} });
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_callback2(transport);
} });
}
</script>";
}
</script>";
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<table width=\"100%\" class=\"prefPrefsList\">";
$result = db_query($this->link, "SELECT email,full_name,
access_level FROM ttrss_users
WHERE id = ".$_SESSION["uid"]);
$result = db_query($this->link, "SELECT email,full_name,
access_level FROM ttrss_users
WHERE id = ".$_SESSION["uid"]);
$email = htmlspecialchars(db_fetch_result($result, 0, "email"));
$full_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
$email = htmlspecialchars(db_fetch_result($result, 0, "email"));
$full_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
print "<tr><td width=\"40%\">".__('Full name')."</td>";
print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"
value=\"$full_name\"></td></tr>";
print "<tr><td width=\"40%\">".__('Full name')."</td>";
print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"
value=\"$full_name\"></td></tr>";
print "<tr><td width=\"40%\">".__('E-mail')."</td>";
print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"email\" required=\"1\" value=\"$email\"></td></tr>";
print "<tr><td width=\"40%\">".__('E-mail')."</td>";
print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"email\" required=\"1\" value=\"$email\"></td></tr>";
if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) {
if (!SINGLE_USER_MODE) {
$access_level = db_fetch_result($result, 0, "access_level");
print "<tr><td width=\"40%\">".__('Access level')."</td>";
print "<td>" . $access_level_names[$access_level] . "</td></tr>";
}
$access_level = db_fetch_result($result, 0, "access_level");
print "<tr><td width=\"40%\">".__('Access level')."</td>";
print "<td>" . $access_level_names[$access_level] . "</td></tr>";
}
print "</table>";
print "</table>";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changeemail\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changeemail\">";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
__("Save data")."</button>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
__("Save data")."</button>";
print "</form>";
print "</form>";
if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) {
$result = db_query($this->link, "SELECT id FROM ttrss_users
WHERE id = ".$_SESSION["uid"]." AND pwd_hash
......@@ -270,9 +271,10 @@ class Pref_Prefs extends Protected_Handler {
print "</form>";
print "</div>"; #pane
}
print "</div>"; #pane
print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"".__('Preferences')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">";
......
......@@ -38,23 +38,23 @@ class Public_Handler extends Handler {
$tpl->readTemplateFromFile("templates/generated_feed.txt");
$tpl->setVariable('FEED_TITLE', $feed_title);
$tpl->setVariable('VERSION', VERSION);
$tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url));
$tpl->setVariable('FEED_TITLE', $feed_title, true);
$tpl->setVariable('VERSION', VERSION, true);
$tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true);
if (PUBSUBHUBBUB_HUB && $feed == -2) {
$tpl->setVariable('HUB_URL', htmlspecialchars(PUBSUBHUBBUB_HUB));
$tpl->setVariable('HUB_URL', htmlspecialchars(PUBSUBHUBBUB_HUB), true);
$tpl->addBlock('feed_hub');
}
$tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()));
$tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
while ($line = db_fetch_assoc($result)) {
$tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']));
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']));
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']));
$tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
$tpl->setVariable('ARTICLE_EXCERPT',
truncate_string(strip_tags($line["content_preview"]), 100, '...'));
truncate_string(strip_tags($line["content_preview"]), 100, '...'), true);
$content = sanitize($this->link, $line["content_preview"], false, $owner_uid);
......@@ -63,15 +63,19 @@ class Public_Handler extends Handler {
$content;
}
$tpl->setVariable('ARTICLE_CONTENT', $content);
$tpl->setVariable('ARTICLE_CONTENT', $content, true);
$tpl->setVariable('ARTICLE_UPDATED', date('c', strtotime($line["updated"])));
$tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']));
$tpl->setVariable('ARTICLE_UPDATED_ATOM',
date('c', strtotime($line["updated"])), true);
$tpl->setVariable('ARTICLE_UPDATED_RFC822',
date(DATE_RFC822, strtotime($line["updated"])), true);
$tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
$tags = get_article_tags($this->link, $line["id"], $owner_uid);
foreach ($tags as $tag) {
$tpl->setVariable('ARTICLE_CATEGORY', htmlspecialchars($tag));
$tpl->setVariable('ARTICLE_CATEGORY', htmlspecialchars($tag), true);
$tpl->addBlock('category');
}
......@@ -82,9 +86,9 @@ class Public_Handler extends Handler {
$url = htmlspecialchars($e['content_url']);
$length = $e['duration'];
$tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url);
$tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type);
$tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', $length);
$tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url, true);
$tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type, true);
$tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', $length, true);
$tpl->addBlock('enclosure');
}
......
......@@ -186,6 +186,9 @@
define('ENABLE_GZIP_OUTPUT', false);
// Selectively gzip output to improve wire performance. This requires
// PHP Zlib extension on the server.
// Enabling this can break tt-rss in several httpd/php configurations,
// if you experience weird errors and tt-rss failing to start, blank pages
// after login, or content encoding errors, disable it.
define('FEEDBACK_URL', '');
// Displays an URL for users to provide feedback or comments regarding
......
......@@ -374,7 +374,33 @@
$favicon_url = get_favicon_url($site_url);
if ($favicon_url) {
$contents = fetch_file_contents($favicon_url, "image");
// Limiting to "image" type misses those served with text/plain
$contents = fetch_file_contents($favicon_url); // , "image");
if ($contents) {
// Crude image type matching.
// Patterns gleaned from the file(1) source code.
if (preg_match('/^\x00\x00\x01\x00/', $contents)) {
// 0 string \000\000\001\000 MS Windows icon resource
//error_log("check_feed_favicon: favicon_url=$favicon_url isa MS Windows icon resource");
}
elseif (preg_match('/^GIF8/', $contents)) {
// 0 string GIF8 GIF image data
//error_log("check_feed_favicon: favicon_url=$favicon_url isa GIF image");
}
elseif (preg_match('/^\x89PNG\x0d\x0a\x1a\x0a/', $contents)) {
// 0 string \x89PNG\x0d\x0a\x1a\x0a PNG image data
//error_log("check_feed_favicon: favicon_url=$favicon_url isa PNG image");
}
elseif (preg_match('/^\xff\xd8/', $contents)) {
// 0 beshort 0xffd8 JPEG image data
//error_log("check_feed_favicon: favicon_url=$favicon_url isa JPG image");
}
else {
//error_log("check_feed_favicon: favicon_url=$favicon_url isa UNKNOWN type");
$contents = "";
}
}
if ($contents) {
$fp = @fopen($icon_file, "w");
......@@ -811,6 +837,11 @@
$_SESSION["uid"] = 1;
$_SESSION["name"] = "admin";
$_SESSION["access_level"] = 10;
if (!$_SESSION["csrf_token"]) {
$_SESSION["csrf_token"] = sha1(uniqid(rand(), true));
}
$_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"];
......@@ -4411,7 +4442,7 @@
if ($cat_id == -4 || $cat_id == -3) {
$result = db_query($link, "SELECT
id, feed_url, cat_id, title, ".
id, feed_url, cat_id, title, order_id, ".
SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
FROM ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"] .
" ORDER BY cat_id, title " . $limit_qpart);
......@@ -4423,7 +4454,7 @@
$cat_qpart = "cat_id IS NULL";
$result = db_query($link, "SELECT
id, feed_url, cat_id, title, ".
id, feed_url, cat_id, title, order_id, ".
SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
FROM ttrss_feeds WHERE
$cat_qpart AND owner_uid = " . $_SESSION["uid"] .
......@@ -4445,7 +4476,8 @@
"unread" => (int)$unread,
"has_icon" => $has_icon,
"cat_id" => (int)$line["cat_id"],
"last_updated" => strtotime($line["last_updated"])
"last_updated" => strtotime($line["last_updated"]),
"order_id" => (int) $line["order_id"],
);
array_push($feeds, $row);
......@@ -4510,6 +4542,8 @@
$headline_row["labels"] = $labels;
$headline_row["feed_title"] = $line["feed_title"];
array_push($headlines, $headline_row);
}
......@@ -4802,7 +4836,9 @@
* @return string Absolute URL
*/
function rewrite_relative_url($url, $rel_url) {
if (strpos($rel_url, "://") !== false) {
if (strpos($rel_url, "magnet:") === 0) {
return $rel_url;
} else if (strpos($rel_url, "://") !== false) {
return $rel_url;
} else if (strpos($rel_url, "/") === 0)
{
......
<?php # This file has been generated at: Mon Jan 30 16:39:34 MSK 2012
<?php # This file has been generated at: Thu Mar 29 15:07:22 MSK 2012
__("Title");
__("Title or Content");
......@@ -20,7 +20,7 @@ __("Advanced");
__('This option is useful when you are reading several planet-type aggregators with partially colliding userbase. When disabled, it forces same posts from different feeds to appear only once.');
__('Display expanded list of feed articles, instead of separate displays for headlines and article content');
__('When "Mark as read" button is clicked in toolbar, automatically open next feed with unread articles.');
__('Automatically open next feed with unread articles after marking one as read');
__('This option enables sending daily digest of new (and unread) headlines on your configured e-mail address');
__('This option enables marking articles as read automatically while you scroll article list.');
__('Strip all but most common HTML tags when reading articles.');
......@@ -29,7 +29,7 @@ __('When this option is enabled, headlines in Special feeds and Labels are group
__('Use feed-specified date to sort headlines instead of local import date.');
__('Customize CSS stylesheet to your liking');
__('Click to register your SSL client certificate with tt-rss');
__('Uses server timezone');
__('Uses UTC timezone');
__('Purge old posts after this number of days (0 - disables)');
__('Default interval between feed updates');
__('Amount of articles to display at once');
......
......@@ -81,7 +81,8 @@
) OR (
ttrss_feeds.update_interval > 0
AND ttrss_feeds.last_updated < NOW() - CAST((ttrss_feeds.update_interval || ' minutes') AS INTERVAL)
) OR ttrss_feeds.last_updated IS NULL)";
) OR ttrss_feeds.last_updated IS NULL
OR last_updated = '1970-01-01 00:00:00')";
} else {
$update_limit_qpart = "AND ((
ttrss_feeds.update_interval = 0
......@@ -89,7 +90,8 @@
) OR (
ttrss_feeds.update_interval > 0
AND ttrss_feeds.last_updated < DATE_SUB(NOW(), INTERVAL ttrss_feeds.update_interval MINUTE)
) OR ttrss_feeds.last_updated IS NULL)";
) OR ttrss_feeds.last_updated IS NULL
OR last_updated = '1970-01-01 00:00:00')";
}
// Test if feed is currently being updated by another process.
......@@ -254,7 +256,7 @@
}
$result = db_query($link, "SELECT id,update_interval,auth_login,
auth_pass,cache_images,update_method
auth_pass,cache_images,update_method,last_updated
FROM ttrss_feeds WHERE id = '$feed' AND $updstart_thresh_qpart");
} else {
......@@ -310,12 +312,9 @@
$auth_pass = urlencode($auth_pass);
}
$update_interval = db_fetch_result($result, 0, "update_interval");
$cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images"));
$fetch_url = db_fetch_result($result, 0, "feed_url");
if ($update_interval < 0) { return false; }
$feed = db_escape_string($feed);
if ($auth_login && $auth_pass ){
......@@ -347,11 +346,15 @@
} else {
// Ignore cache if new feed or manual update.
$cache_age = (is_null($last_updated) || $last_updated == '1970-01-01 00:00:00') ?
-1 : get_feed_update_interval($link, $feed) * 60;
if ($update_method == 3) {
$rss = fetch_twitter_rss($link, $fetch_url, $owner_uid);
} else if ($update_method == 1) {
define('MAGPIE_CACHE_AGE', get_feed_update_interval($link, $feed) * 60);
define('MAGPIE_CACHE_AGE', $cache_age);
define('MAGPIE_CACHE_ON', !$no_cache);
define('MAGPIE_FETCH_TIME_OUT', 60);
define('MAGPIE_CACHE_DIR', CACHE_DIR . "/magpie");
......@@ -380,7 +383,7 @@
if (!$no_cache) {
$rss->set_cache_location($simplepie_cache_dir);
$rss->set_cache_duration(get_feed_update_interval($link, $feed) * 60);
$rss->set_cache_duration($cache_age);
}
$rss->init();
......@@ -662,7 +665,7 @@
$entry_content = $item["content:escaped"];
if (!$entry_content) $entry_content = $item["content:encoded"];
if (!$entry_content) $entry_content = $item["content"]["encoded"];
if (!$entry_content && is_array($entry_content)) $entry_content = $item["content"]["encoded"];
if (!$entry_content) $entry_content = $item["content"];
if (is_array($entry_content)) $entry_content = $entry_content[0];
......@@ -1369,14 +1372,15 @@
if (is_writable($cache_dir)) {
$files = glob("$cache_dir/*");
foreach ($files as $file) {
if (time() - filemtime($file) > 86400*7) {
unlink($file);
if ($files)
foreach ($files as $file) {
if (time() - filemtime($file) > 86400*7) {
unlink($file);
++$num_deleted;
++$num_deleted;
}
}
}
}
if ($debug) _debug("Removed $num_deleted files.");
}
......
This diff is collapsed.
<?php
define('VERSION', "1.5.10");
define('VERSION', "1.5.11");
?>
......@@ -93,7 +93,7 @@
</div>
<div id="header">
<?php if (!SINGLE_USER_MODE) { ?>
<?php if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
<?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
<?php } ?>
<a href="prefs.php"><?php echo __('Preferences') ?></a>
......@@ -103,7 +103,7 @@
<?php echo __('Comments?') ?></a>
<?php } ?>
<?php if (!SINGLE_USER_MODE) { ?>
<?php if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
| <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
<?php } ?>
......
......@@ -433,5 +433,14 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
}
},
getFeedCategory: function(feed) {
try {
return this.getNodesByItem(this.model.store.
_itemsByIdentity["FEED:" + feed])[0].
getParent().item.bare_id[0];
} catch (e) {
return false;
}
},
});
......@@ -71,7 +71,8 @@ function viewfeed(feed, method, is_cat, offset, background, infscroll_req) {
// switching to a different feed, we might as well catchup stuff visible
// in headlines buffer (if any)
if (!background && isCdmMode() && getInitParam("cdm_auto_catchup") == 1 && parseInt(getActiveFeedId()) > 0) {
// disabled for now because this behavior is considered confusing -fox
/* if (!background && isCdmMode() && getInitParam("cdm_auto_catchup") == 1 && parseInt(getActiveFeedId()) > 0) {
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
function(child) {
......@@ -97,7 +98,7 @@ function viewfeed(feed, method, is_cat, offset, background, infscroll_req) {
}
});
}
} */
}
if (offset == 0 && !background)
......@@ -148,39 +149,6 @@ function viewfeed(feed, method, is_cat, offset, background, infscroll_req) {
_search_query = false;
}
if (method == "MarkAllRead") {
var show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
if (show_next_feed) {