From: Andrew Dolgov Date: Mon, 16 Jan 2017 08:36:00 +0000 (+0300) Subject: Merge branch 'subscribe-idn-feed' into 'master' X-Git-Tag: 17.1~18 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f6bcb5c60687f6d8d57612057996852e144c8c61;hp=62958fe9dcc72a9b93e8b9259c580a472fb3ce7f;p=tt-rss.git Merge branch 'subscribe-idn-feed' into 'master' Subscribe to feed with Internationalized Domain Name Currently you cannot subscribe to feeds on hosts with internationalized domain names (IDNA) within tt-rss. You need to manually convert them to punycode to subscribe to them. This patch adds code to detect IDNA and convert them to punycode in fix_url() if possible on the system. This requires PHP IDN functions (e.g. on Debian Jessie this needs php5-intl to be installed), so a notice is added to the installer sanity check. See merge request !37 --- diff --git a/classes/article.php b/classes/article.php index 9a7c6870..46e9bb79 100644 --- a/classes/article.php +++ b/classes/article.php @@ -209,7 +209,7 @@ class Article extends Handler_Protected { print ""; - print "
"; print "
"; diff --git a/classes/feeds.php b/classes/feeds.php index afbeb249..8f101e5c 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -86,17 +86,23 @@ class Feeds extends Handler_Protected { $reply .= ""; $reply .= ""; - $reply .= " + /*$reply .= " ".__('All').", ".__('Unread').", ".__('Invert').", ".__('None').""; - $reply .= " "; + $reply .= " "; */ $reply .= " diff --git a/install/index.php b/install/index.php index d9e370ea..7da311ff 100755 --- a/install/index.php +++ b/install/index.php @@ -128,12 +128,6 @@ $finished = false; - if (function_exists("mcrypt_decrypt")) { - $crypt_key = make_password(24); - } else { - $crypt_key = ""; - } - foreach ($data as $line) { if (preg_match("/define\('DB_TYPE'/", $line)) { $rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n"; @@ -149,8 +143,6 @@ $rv .= "\tdefine('DB_PORT', '$DB_PORT');\n"; } else if (preg_match("/define\('SELF_URL_PATH'/", $line)) { $rv .= "\tdefine('SELF_URL_PATH', '$SELF_URL_PATH');\n"; - } else if (preg_match("/define\('FEED_CRYPT_KEY'/", $line)) { - $rv .= "\tdefine('FEED_CRYPT_KEY', '$crypt_key');\n"; } else if (!$finished) { $rv .= "$line\n"; } diff --git a/js/tt-rss.js b/js/tt-rss.js index 1b84025d..068ad084 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -822,13 +822,7 @@ function parse_runtime_info(data) { function collapse_feedlist() { try { - if (!Element.visible('feeds-holder')) { - Element.show('feeds-holder'); - $("collapse_feeds_btn").innerHTML = "<<"; - } else { - Element.hide('feeds-holder'); - $("collapse_feeds_btn").innerHTML = ">>"; - } + Element.toggle("feeds-holder"); dijit.byId("main").resize(); diff --git a/plugins/mail/init.php b/plugins/mail/init.php index eba4a5ce..acd89de4 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -162,7 +162,8 @@ class Mail extends Plugin { print "
"; print "
"; diff --git a/plugins/toggle_sidebar/application_side_list.png b/plugins/toggle_sidebar/application_side_list.png new file mode 100644 index 00000000..248eaf1a Binary files /dev/null and b/plugins/toggle_sidebar/application_side_list.png differ diff --git a/plugins/toggle_sidebar/init.php b/plugins/toggle_sidebar/init.php new file mode 100644 index 00000000..b2b0821a --- /dev/null +++ b/plugins/toggle_sidebar/init.php @@ -0,0 +1,34 @@ +host = $host; + + $host->add_hook($host::HOOK_MAIN_TOOLBAR_BUTTON, $this); + } + + function hook_main_toolbar_button() { + ?> + + + + diff --git a/update.php b/update.php index f1743618..821d25bc 100755 --- a/update.php +++ b/update.php @@ -38,6 +38,7 @@ "debug-feed:", "force-refetch", "force-rehash", + "decrypt-feeds", "help"); foreach (PluginHost::getInstance()->get_commands() as $command => $data) { @@ -91,6 +92,7 @@ print " --debug-feed N - perform debug update of feed N\n"; print " --force-refetch - debug update: force refetch feed data\n"; print " --force-rehash - debug update: force rehash articles\n"; + print " --decrypt-feeds - decrypt feed passwords\n"; print " --help - show this help\n"; print "Plugin options:\n"; @@ -402,8 +404,40 @@ update_rss_feed($feed); } + if (isset($options["decrypt-feeds"])) { + $result = db_query("SELECT id, auth_pass FROM ttrss_feeds WHERE auth_pass_encrypted = true"); + + if (!function_exists("mcrypt_decrypt")) { + _debug("mcrypt functions not available."); + return; + } + + require_once "crypt.php"; + + $total = 0; + + db_query("BEGIN"); + + while ($line = db_fetch_assoc($result)) { + _debug("processing feed id " . $line["id"]); + + $auth_pass = db_escape_string(decrypt_string($line["auth_pass"])); + + db_query("UPDATE ttrss_feeds SET auth_pass_encrypted = false, auth_pass = '$auth_pass' + WHERE id = " . $line["id"]); + + ++$total; + } + + db_query("COMMIT"); + + _debug("$total feeds processed."); + } + PluginHost::getInstance()->run_commands($options); if (file_exists(LOCK_DIRECTORY . "/$lock_filename")) + if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') + fclose($lock_handle); unlink(LOCK_DIRECTORY . "/$lock_filename"); ?>