X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Fpref%2Ffeeds.php;h=d6abe2328809482ee20edb182043431a367c0acc;hb=fbff72e081e812926f89e608cf7af1b7d8c841cb;hp=c0b209f57cae11075051104b569250764100e92f;hpb=f1415df47cd70d76a8be769b71f2fca446d60861;p=tt-rss.git
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index c0b209f5..d6abe232 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -71,7 +71,7 @@ class Pref_Feeds extends Handler_Protected {
$fsth = $this->pdo->prepare("SELECT id, title, last_error,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
FROM ttrss_feeds
- WHERE cat_id = :cat AND
+ WHERE cat_id = :cat AND
owner_uid = :uid AND
(:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search))
ORDER BY order_id, title");
@@ -238,9 +238,9 @@ class Pref_Feeds extends Handler_Protected {
$cat['child_unread'] = 0;
$fsth = $this->pdo->prepare("SELECT id, title,last_error,
- ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
+ ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
FROM ttrss_feeds
- WHERE cat_id IS NULL AND
+ WHERE cat_id IS NULL AND
owner_uid = :uid AND
(:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search))
ORDER BY order_id, title");
@@ -328,13 +328,12 @@ class Pref_Feeds extends Handler_Protected {
}
private function process_category_order(&$data_map, $item_id, $parent_id = false, $nest_level = 0) {
- $debug = isset($_REQUEST["debug"]);
$prefix = "";
for ($i = 0; $i < $nest_level; $i++)
$prefix .= " ";
- if ($debug) _debug("$prefix C: $item_id P: $parent_id");
+ Debug::log("$prefix C: $item_id P: $parent_id");
$bare_item_id = substr($item_id, strpos($item_id, ':')+1);
@@ -361,7 +360,7 @@ class Pref_Feeds extends Handler_Protected {
$id = $item['_reference'];
$bare_id = substr($id, strpos($id, ':')+1);
- if ($debug) _debug("$prefix [$order_id] $id/$bare_id");
+ Debug::log("$prefix [$order_id] $id/$bare_id");
if ($item['_reference']) {
@@ -513,8 +512,6 @@ class Pref_Feeds extends Handler_Protected {
print '
';
- $auth_pass_encrypted = $row["auth_pass_encrypted"];
-
$title = htmlspecialchars($row["title"]);
print_hidden("id", "$feed_id");
@@ -565,6 +562,18 @@ class Pref_Feeds extends Handler_Protected {
'dojoType="dijit.form.Select"');
}
+ /* Site URL */
+
+ $site_url = htmlspecialchars($row["site_url"]);
+
+ print "
";
+
+ print __('Site URL:') . " ";
+ print "";
+
/* FTS Stemming Language */
if (DB_TYPE == "pgsql") {
@@ -591,6 +600,7 @@ class Pref_Feeds extends Handler_Protected {
/* Purge intl */
+ if (FORCE_ARTICLE_PURGE == 0) {
$purge_interval = $row["purge_interval"];
print "
";
@@ -599,18 +609,13 @@ class Pref_Feeds extends Handler_Protected {
print_select_hash("purge_interval", $purge_interval, $purge_intervals,
'dojoType="dijit.form.Select" ' .
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
+ }
print "";
$auth_login = htmlspecialchars($row["auth_login"]);
- $auth_pass = $row["auth_pass"];
-
- if ($auth_pass_encrypted && function_exists("mcrypt_decrypt")) {
- require_once "crypt.php";
- $auth_pass = decrypt_string($auth_pass);
- }
+ $auth_pass = htmlspecialchars($row["auth_pass"]);
- $auth_pass = htmlspecialchars($auth_pass);
$auth_enabled = $auth_login !== '' || $auth_pass !== '';
$auth_style = $auth_enabled ? '' : 'display: none';
@@ -623,7 +628,6 @@ class Pref_Feeds extends Handler_Protected {
autocomplete=\"new-password\"
name=\"auth_login\" value=\"$auth_login\">
";
-
print "
";
+ if (DIGEST_SUBJECT !== false) {
$include_in_digest = $row["include_in_digest"];
if ($include_in_digest) {
@@ -669,6 +674,7 @@ class Pref_Feeds extends Handler_Protected {
print "
";
+ }
$always_display_enclosures = $row["always_display_enclosures"];
@@ -694,7 +700,7 @@ class Pref_Feeds extends Handler_Protected {
print "
";
+ __('Do not embed media')."";
$cache_images = $row["cache_images"];
@@ -742,7 +748,7 @@ class Pref_Feeds extends Handler_Protected {
-
+
"; # pane
- if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
-
- print "";
-
- print_notice(__('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.'));
-
- print "
";
-
- print "";
-
- print "
";
-
- print "
"; # pane
- }
-
print "";
print "
" . __('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.') . "
";
@@ -1559,12 +1548,10 @@ class Pref_Feeds extends Handler_Protected {
}
static function remove_feed($id, $owner_uid) {
- $debug = isset($_REQUEST["debug"]);
-
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_UNSUBSCRIBE_FEED) as $p) {
- if( ! $p->hook_unsubscribe_feed($id, $owner_uid)){
- if($debug) _debug("Feed not removed due to Error in Plugin. (HOOK_UNSUBSCRIBE_FEED)");
- return;
+ if (! $p->hook_unsubscribe_feed($id, $owner_uid)) {
+ user_error("Feed $id (owner: $owner_uid) not removed due to plugin error (HOOK_UNSUBSCRIBE_FEED).", E_USER_WARNING);
+ return;
}
}
@@ -1728,11 +1715,11 @@ class Pref_Feeds extends Handler_Protected {
function regenFeedKey() {
$feed_id = clean($_REQUEST['id']);
- $is_cat = clean($_REQUEST['is_cat']) == "true";
+ $is_cat = clean($_REQUEST['is_cat']);
$new_key = $this->update_feed_access_key($feed_id, $is_cat);
- print json_encode(array("link" => $new_key));
+ print json_encode(["link" => $new_key]);
}
@@ -1742,7 +1729,7 @@ class Pref_Feeds extends Handler_Protected {
// clear old value and generate new one
$sth = $this->pdo->prepare("DELETE FROM ttrss_access_keys
WHERE feed_id = ? AND is_cat = ? AND owner_uid = ?");
- $sth->execute([$feed_id, $is_cat, $owner_uid]);
+ $sth->execute([$feed_id, bool_to_sql_bool($is_cat), $owner_uid]);
return get_feed_access_key($feed_id, $is_cat, $owner_uid);
}