Commit 60207356 authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.5.5

parent 64fcb6e7
......@@ -62,8 +62,14 @@
$op != "rss" && $op != "getUnread" && $op != "getProfiles" &&
$op != "fbexport" && $op != "logout" && $op != "pubsub") {
header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 6)));
if ($op == 'pref-feeds' && $_REQUEST['subop'] == 'add') {
header("Content-Type: text/html");
login_sequence($link);
render_login_form($link);
} else {
header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 6)));
}
return;
}
......@@ -547,34 +553,41 @@
$result = db_query($link, "SELECT feed_url FROM ttrss_feeds
WHERE id = '$feed_id'");
$check_feed_url = db_fetch_result($result, 0, "feed_url");
if (db_num_rows($result) != 0) {
if ($check_feed_url && ($check_feed_url == $feed_url || !$feed_url)) {
if ($mode == "subscribe") {
$check_feed_url = db_fetch_result($result, 0, "feed_url");
db_query($link, "UPDATE ttrss_feeds SET pubsub_state = 2
WHERE id = '$feed_id'");
if ($check_feed_url && ($check_feed_url == $feed_url || !$feed_url)) {
if ($mode == "subscribe") {
print $_REQUEST['hub_challenge'];
return;
db_query($link, "UPDATE ttrss_feeds SET pubsub_state = 2
WHERE id = '$feed_id'");
} else if ($mode == "unsubscribe") {
print $_REQUEST['hub_challenge'];
return;
db_query($link, "UPDATE ttrss_feeds SET pubsub_state = 0
WHERE id = '$feed_id'");
} else if ($mode == "unsubscribe") {
print $_REQUEST['hub_challenge'];
return;
db_query($link, "UPDATE ttrss_feeds SET pubsub_state = 0
WHERE id = '$feed_id'");
print $_REQUEST['hub_challenge'];
return;
} else if (!$mode) {
} else if (!$mode) {
// Received update ping, schedule feed update.
// Received update ping, schedule feed update.
update_rss_feed($link, $feed_id, true, true);
update_rss_feed($link, $feed_id, true, true);
}
} else {
header('HTTP/1.0 404 Not Found');
echo "404 Not found";
}
} else {
header('HTTP/1.0 404 Not Found');
echo "404 Not found";
}
break; // pubsub
......
......@@ -362,7 +362,7 @@
$login = urlencode($login);
$pass = urlencode($pass);
if (function_exists('curl_init')) {
if (function_exists('curl_init') && !ini_get("open_basedir")) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
......@@ -373,6 +373,7 @@
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
if ($post_query) {
curl_setopt($ch, CURLOPT_POST, true);
......@@ -815,7 +816,8 @@
if ($debug_enabled) _debug("update_rss_feed: feed hub url: $feed_hub_url");
if ($feed_hub_url && function_exists('curl_init')) {
if ($feed_hub_url && function_exists('curl_init') &&
!ini_get("open_basedir")) {
$callback_url = get_self_url_prefix() .
"/backend.php?op=pubsub&id=$feed";
......@@ -1825,10 +1827,7 @@
}
}
function http_authenticate_user($link) {
// error_log("http_authenticate_user: ".$_SERVER["PHP_AUTH_USER"]."\n", 3, '/tmp/tt-rss.log');
/* function http_authenticate_user($link) {
if (!$_SERVER["PHP_AUTH_USER"]) {
header('WWW-Authenticate: Basic realm="Tiny Tiny RSS RSSGen"');
......@@ -1847,7 +1846,7 @@
}
return true;
}
} */
function get_ssl_certificate_id() {
if ($_SERVER["REDIRECT_SSL_CLIENT_M_SERIAL"]) {
......
......@@ -38,6 +38,15 @@
</td><td valign='top'>
<h2><?php echo __("Multiple articles actions") ?></h2>
<table>
<tr><td class='n'>a a</td><td><?php echo __("Select all articles") ?></td></tr>
<tr><td class='n'>a u</td><td><?php echo __("Select unread articles") ?></td></tr>
<tr><td class='n'>a i</td><td><?php echo __("Invert article selection") ?></td></tr>
<tr><td class='n'>a n</td><td><?php echo __("Deselect all articles") ?></td></tr>
</table>
<h2><?php echo __("Feed actions") ?></h2>
<table>
......
......@@ -323,7 +323,11 @@
$feed_id = $feed_id;
$limit = 15;
$filter = '';
$view_mode = 'adaptive';
if (!mobile_get_pref($link, "HIDE_READ"))
$view_mode = "all_articles";
else
$view_mode = 'adaptive';
if ($search) {
$search_mode = 'this_feed';
......@@ -334,7 +338,8 @@
}
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
$view_mode, $is_cat, $search, $search_mode, $match_on, false, $offset);
$view_mode, $is_cat, $search, $search_mode, $match_on,
"unread DESC, updated, score", $offset);
$result = $qfh_ret[0];
$feed_title = $qfh_ret[1];
......@@ -464,9 +469,18 @@
selected=\"true\"
myBackLabel='$feed_title' myBackHref='feed.php?id=$feed_id&cat=$cat_id&is_cat=$is_cat'>";
print "<h2><a target='_blank' href='$article_link'>$title</a></h2>";
if ($line['feed_id'] != $feed_id) {
$real_feed_title = getFeedTitle($link, $line['feed_id']);
$real_feed_id = $line['feed_id'];
$feed_link = "(<a href=\"feed.php?id=$real_feed_id\">$real_feed_title</a>)";
}
// print "<fieldset>";
print "<fieldset>";
print "<div style='float : right'>($updated_fmt)</div>";
print "<h2><a target='_blank' href='$article_link'>$title</a> $feed_link</h2>";
print "<hr>";
/* print "<div class=\"row\">";
print "<label id='title'><a target='_blank' href='$article_link'>$title</a></label>";
......@@ -475,12 +489,12 @@
$is_starred = (sql_bool_to_bool($line["marked"])) ? "true" : "false";
$is_published = (sql_bool_to_bool($line["published"])) ? "true" : "false";
print "<div class=\"row\">";
print "<label id='updated'>Updated:</label>";
print "<input enabled='false' name='updated' disabled value='$updated_fmt'/>";
print "</div>";
//print "<div class=\"row\">";
//print "<label id='updated'>Updated:</label>";
//print "<input enabled='false' name='updated' disabled value='$updated_fmt'/>";
//print "</div>";
print "</fieldset>";
// print "</fieldset>";
$content = sanitize_rss($link, $line["content"]);
$content = preg_replace("/href=/i", "target=\"_blank\" href=", $content);
......
......@@ -7,11 +7,11 @@
require_once "../config.php";
require_once "functions.php";
require_once "../functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
......@@ -43,7 +43,7 @@
</div>
<div class="row">
<label><?php echo __('Hide read feeds') ?></label>
<label><?php echo __('Hide read articles and feeds') ?></label>
<div class="toggle" id="HIDE_READ" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "HIDE_READ") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
</div>
......
......@@ -79,8 +79,12 @@
array_push($cat['items'], $feed);
}
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
if (count($cat['items']) > 0)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
}
/* Uncategorized is a special case */
......@@ -112,9 +116,14 @@
array_push($cat['items'], $feed);
}
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
if (count($cat['items']) > 0)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
$root['param'] = T_sprintf('(%d feeds)', $root['param']);
} else {
$feed_result = db_query($link, "SELECT id, title, last_error,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
......@@ -135,6 +144,9 @@
array_push($root['items'], $feed);
}
$root['param'] = T_sprintf('(%d feeds)', count($root['items']));
}
$fl = array();
......@@ -1022,6 +1034,9 @@
case 2:
print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
break;
case 3:
print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
break;
case 0:
print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
break;
......
......@@ -115,7 +115,7 @@
if (!function_exists('curl_init')) {
print "<div style='padding : 1em'>";
print_error("This functionality requires CURL functions. Please enable CURL in your PHP configuration and reload this page.");
print_error("This functionality requires CURL functions. Please enable CURL in your PHP configuration (you might also want to disable open_basedir in php.ini) and reload this page.");
print "</div>";
}
......
......@@ -115,9 +115,9 @@
$err_msg = "config: your ICONS_DIR (" . ICONS_DIR . ") is not writable.\n";
}
if (ini_get("open_basedir")) {
/* if (ini_get("open_basedir")) {
$err_msg = "php.ini: open_basedir is not supported.";
}
} */
if (!function_exists("curl_init") && !ini_get("allow_url_fopen")) {
$err_msg = "php.ini: either allow_url_fopen or CURL needs to be enabled.";
......
......@@ -654,7 +654,7 @@ function hotkey_handler(e) {
if (keycode == 16) return; // ignore lone shift
if (keycode == 17) return; // ignore lone ctrl
if ((keycode == 70 || keycode == 67 || keycode == 71)
if ((keycode == 70 || keycode == 67 || keycode == 71 || keycode == 65)
&& !hotkey_prefix) {
var date = new Date();
......@@ -766,7 +766,6 @@ function hotkey_handler(e) {
return;
}
if (keycode == 85) { // u
selectionToggleUnread(undefined, false, true)
return;
......@@ -815,6 +814,33 @@ function hotkey_handler(e) {
}
}
/* Prefix a */
if (hotkey_prefix == 65) { // a
hotkey_prefix = false;
if (keycode == 65) { // a
selectArticles('all');
return;
}
if (keycode == 85) { // u
selectArticles('unread');
return;
}
if (keycode == 73) { // i
selectArticles('invert');
return;
}
if (keycode == 78) { // n
selectArticles('none');
return;
}
}
/* Prefix f */
if (hotkey_prefix == 70) { // f
......
<?php
define('VERSION', "1.5.4");
define('VERSION', "1.5.5");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment