Commit Graph

795 Commits

Author SHA1 Message Date
Andrew Dolgov e7c9bc60ec fix previous wrt if-modified-since being added to context options headers 2018-02-25 14:22:46 +03:00
Metallizzer dd597297cb Обновить 'include/functions.php'
The "Connection: close" header is added to the context_options
2018-02-25 10:03:09 +00:00
Andrew Dolgov 3d7db21602 Merge branch 'master' of git.fakecake.org:tt-rss 2018-02-12 09:37:31 +03:00
Andrew Dolgov 8babb8e75a sanitize: disallow width and height attributes for images 2018-02-11 16:47:19 +03:00
fox 1aeb282be1 Merge branch 'save-effective-url' of JustAMacUser/tt-rss into master 2018-02-11 08:57:12 +00:00
JustAMacUser 7ae05ed790 Have fetch_file_contents() save the effective URL. 2018-02-11 07:56:28 +00:00
Andrew Dolgov 2eaf2a1f36 tag_is_valid: simplify code 2018-02-11 10:26:33 +03:00
Andrew Dolgov 7f4a404566 include: convert some spaces to tabs 2018-01-30 10:44:31 +03:00
martin scharm 32dc9ec854 undocumenting the proxy settings [see #36]
in response to https://git.tt-rss.org/git/tt-rss/pulls/36#issuecomment-119
2018-01-18 08:48:53 +01:00
martin scharm 213c01d459 some proxies require `request_fulluri` set to true [see #36]
at least polipo won't work for plain HTTP URLs (HTTPS strangely also works without `request_fulluri`..?)

see https://git.tt-rss.org/git/tt-rss/pulls/36
2018-01-17 12:28:47 +01:00
martin scharm ea55f2e11c Add proper support for proxies
There are situations where you want tt-rss to use a proxy (e.g.
because of network restrictions, or privacy concerns).
tt-rss already comes with an undocumented `_CURL_HTTP_PROXY`
variable (see eg https://binfalse.de/2015/05/06/ttrss-with-proxy/),
however that won't have an effect when, for example, php-curl is
not installed, see
c30f5e1811/include/functions.php (L377)
In this case it would use the `file_get_contents` with a stream
context without a proxy definition:
c30f5e1811/include/functions.php (L487)

Here I propose to properly support proxies, and I introduced a
`PROXY` variable, that is respected in both scenarios, with and
without curl installed.
2018-01-14 00:30:22 +01:00
Andrew Dolgov 9274109c19 search_to_sql: quote fallback search language 2017-12-30 16:27:05 +03:00
JustAMacUser 56c2216295 Add missing quotes to array_map. 2017-12-30 01:00:56 -05:00
Andrew Dolgov bed2d6e054 force-cast some variables used in queries to integer
do not display SQL query in headlines debug mode
2017-12-17 16:24:13 +03:00
Andrew Dolgov 7651b6e2cd sanitize: disable referrer via referrerpolicy for img elements 2017-12-13 20:07:10 +03:00
Andrew Dolgov 76fc7a2d9c bool_to_sql_bool: for some reason PDO really likes integers for boolean columns
incidentally this fixes OPML filter import
2017-12-06 00:12:28 +03:00
Andrew Dolgov c4a08e4ff0 remove mentions of deprecated.js 2017-12-05 07:09:01 +03:00
Andrew Dolgov e6532439d6 force strip_tags() on all user input unless explicitly allowed 2017-12-03 23:35:38 +03:00
Andrew Dolgov fa3bcfa379 queryfeedheadlines: there's no need to quote order_by/override_order
else: feedicon cache busting etc
2017-12-03 22:49:57 +03:00
Andrew Dolgov 7c0eb1b621 add defaultPasswordWarning nag dialog 2017-12-03 20:46:27 +03:00
Andrew Dolgov bfebf57c5f get_theme_path: fallback to css/default.css if default theme is selected 2017-12-03 14:17:25 +03:00
Andrew Dolgov 2cf93c046c pref-users: fix sorting the table 2017-12-03 13:54:31 +03:00
Andrew Dolgov 8ff3cbb32e filters: remove sql_bool_to_bool()
checkbox_to_sql_bool: return ints (???)
2017-12-03 09:26:11 +03:00
Andrew Dolgov ed5cd6eae5 get_feed_access_key: param type bullshit 2017-12-03 00:25:12 +03:00
Andrew Dolgov 7d960ce7e9 auth_internal: use PDO + other fixes 2017-12-03 00:18:08 +03:00
Andrew Dolgov 4ee398a41e Merge branch 'master' of git.fakecake.org:tt-rss into pdo-experimental 2017-12-02 23:13:49 +03:00
Andrew Dolgov 1e78803c44 search_to_sql: leftover tsquery query fix for pgsql 2017-12-02 23:11:28 +03:00
Andrew Dolgov a2d77092fe search_to_sql: quoting fix 2017-12-02 22:58:59 +03:00
Andrew Dolgov 0002e598f8 sql_bool_to_bool: backwards compat fix 2017-12-02 22:39:34 +03:00
Andrew Dolgov e4befe6bf4 fix label cache being double escaped on save
remove some old-style escaping
2017-12-02 15:47:53 +03:00
Andrew Dolgov ef83c69404 more boolean fixes 2017-12-02 14:13:16 +03:00
Andrew Dolgov da9ea57d1c checkbox to sql bool related changes, some more boolean fixes 2017-12-02 14:07:48 +03:00
Andrew Dolgov 7ccb4e91ff boolean handling changes which probably won't break everything 2017-12-02 14:02:01 +03:00
Andrew Dolgov c949a9282e OPML: use PDO; minor fixes 2017-12-02 01:08:30 +03:00
Andrew Dolgov fbe7cb0a48 rpc: switch to PDO 2017-12-01 23:49:14 +03:00
Andrew Dolgov ecf6baaa1c fix add_feed_category 2017-12-01 22:17:04 +03:00
Andrew Dolgov cc9450c309 ccache, misc: fixes
feeds: start PDO transition
2017-12-01 19:42:02 +03:00
Andrew Dolgov 1271407eea public: partial conversion to PDO, misc fixes 2017-12-01 18:57:34 +03:00
Andrew Dolgov cab58c44ae some minor PDO-related fixes 2017-12-01 18:26:53 +03:00
Andrew Dolgov c9d5c26041 auth/base: PDO
functions: fix small pdo-related bug
2017-12-01 17:40:53 +03:00
Andrew Dolgov fdda3e4efb pdo pdo pdo 2017-12-01 14:50:10 +03:00
Andrew Dolgov 4d13514dd4 sessions: PDO 2017-12-01 14:48:23 +03:00
Andrew Dolgov a21f7495ae more pdo stuff 2017-12-01 14:39:24 +03:00
Andrew Dolgov 90dafaa9f6 add qmarks function 2017-12-01 12:44:54 +03:00
Andrew Dolgov b78a6f08b6 more pdo stuff i guess 2017-12-01 12:42:18 +03:00
Andrew Dolgov 7c4d7bce3f increase default of MAX_CONDITIONAL_INTERVAL to 12 hours 2017-12-01 11:51:46 +03:00
Andrew Dolgov 8aa568b3a2 some more pdo stuff 2017-12-01 10:35:22 +03:00
Andrew Dolgov bfc54b0369 Merge branch 'pdo-experimental' of git.fakecake.org:tt-rss into pdo-experimental 2017-12-01 10:17:36 +03:00
Andrew Dolgov e50c8eaa4e enforce unconditional requests every 6 hours even if server claims data is not modified 2017-11-30 13:12:28 +03:00
Andrew Dolgov ecd2e414bd add ttrss_feeds.last_unconditional (schema bump) 2017-11-30 12:55:50 +03:00
Andrew Dolgov 8adb3ec472 add some WIP pdo stuff 2017-11-30 12:28:07 +03:00
Andrew Dolgov 0b68b1629e add a sanity check for tt-rss myisam tables 2017-11-27 20:09:02 +03:00
woxcab 6eeeec4838 Allow <hr> tag in the RSS item' description 2017-11-03 10:23:29 +03:00
Andrew Dolgov 9d930af9e1 fetch_file_contents: improve error handling
1. if request fails get error string from http  response status line
2. do not override http error with possible CURL/php specific last error
3. fix silent php error generated while processing response headers to get last modified value
2017-10-30 13:13:10 +03:00
Andrew Dolgov 8b73bd28d8 remove apache-specific x-sendfile stuff
implement a hook (HOOK_SEND_LOCAL_FILE) which plugins may use to send files
via httpd-specific implementation to increase performance typically on larger files
2017-10-08 17:14:56 +03:00
wn_ 701c5a7ee4 get_favicon_url: only check base elements with href attribute 2017-10-01 15:47:31 -05:00
wn_ 241f69e4db Handle potentially-relative base element when getting favicon.
The base element's "href" attribute is not required to be absolute,
so rewrite relative to the site URL if it is relative.

See:
* https://www.w3.org/TR/html51/document-metadata.html#the-base-element
* https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
2017-10-01 14:25:12 -05:00
Andrew Dolgov 153cb6d305 add support for http 304 not modified (no timestamp calculation bullshit like last time) 2017-08-17 14:40:21 +03:00
Andrew Dolgov 5e78b0c253 do not base headlines label context submenu on feed tree labels category 2017-07-30 11:55:30 +03:00
Natan Frei e234ac8dcb $_SERVER['HTTPS'] can be exists and 'off' for non-https connectios 2017-07-17 00:44:48 +03:00
Andrew Dolgov 9f7bd151c6 hopefully unify handling of server HTTPS variables where needed, use scheme based on SELF_URL_PATH otherwise 2017-07-10 16:20:40 +03:00
Andrew Dolgov b2d42e960b replace some usages of SELF_URL_PATH with get_self_url_prefix() 2017-07-06 23:01:44 +03:00
Andrew Dolgov 10a1f28f7c schema: updates for new filter format (bump version to 131) 2017-07-02 20:59:24 +03:00
Andrew Dolgov 02f3992a5a Revert "Revert "filters: support matching on multiple feeds/categories""
This reverts commit f5d174bda9.
2017-07-02 20:37:52 +03:00
Andrew Dolgov f5d174bda9 Revert "filters: support matching on multiple feeds/categories"
This reverts commit 0bf7e007bb.
2017-07-02 20:37:01 +03:00
Andrew Dolgov 0bf7e007bb filters: support matching on multiple feeds/categories
opml: update filter export/import for new format
2017-07-02 20:27:21 +03:00
Andrew Dolgov 6fd0399694 tunables:
* add CACHE_MAX_DAYS as a tunable generic expiry interval for various cached files
* add some comments to tunables in functions.php
* rename _MIN_CACHE_FILE_SIZE to MIN_CACHE_FILE_SIZE
* respect MIN_CACHE_FILE_SIZE setting in a few more places where content is cached
2017-05-29 23:14:42 +03:00
Andrew Dolgov 5b6ea1ef91 remove pubsubhubbub: dead 2017-05-16 10:41:20 +03:00
Andrew Dolgov c114a2596f move add_feed_url() to pref_feeds 2017-05-11 09:07:49 +03:00
Andrew Dolgov 4fd0790804 fix DAEMON_SLEEP_INTERVAL not being defined when used
enforce minimum 60 sec spawn/sleep interval in update processes
2017-05-06 10:54:14 +03:00
Andrew Dolgov 65af3b2cbb move counter stuff to a separate class 2017-05-05 11:54:31 +03:00
Andrew Dolgov 7c9b5a3fe4 move label stuff to Labels class
fix some unresolved functions
2017-05-04 15:57:40 +03:00
Andrew Dolgov 0086a89740 move some label stuff to labels.php
move getfeedcategory() to Feeds
2017-05-04 15:36:36 +03:00
Andrew Dolgov 904aff7667 abs_to_rel_path: removed 2017-05-04 15:28:21 +03:00
Andrew Dolgov 2ed0d6c433 move counter cache to a separate class
fix references to get_article_tags
2017-05-04 15:22:57 +03:00
Andrew Dolgov aeb1abedb2 move a bunch of functions into Feeds/Article namespaces
+       static function catchupArticlesById($ids, $cmode, $owner_uid = false) {
+       static function getLastArticleId() {
+       static function queryFeedHeadlines($params) {
+       static function getParentCategories($cat, $owner_uid) {
+       static function getChildCategories($cat, $owner_uid) {

move the rest of functions2.php back to functions.php as it is of more manageable size, remove the former
2017-05-04 15:13:02 +03:00
Andrew Dolgov a230bf88a9 move to Article:
+       static function purge_orphans($do_output = false) {

move to Feeds

+       static function getGlobalUnread($user_id = false) {
+       static function getCategoryTitle($cat_id) {
+       static function getLabelUnread($label_id, $owner_uid = false) {
2017-05-04 15:00:21 +03:00
Andrew Dolgov 86a8351ca2 move the following to Feeds:
+       static function catchup_feed($feed, $cat_view, $owner_uid = false, $mode = 'all', $search = false) {
+       static function getFeedArticles($feed, $is_cat = false, $unread_only = false,
+       static function subscribe_to_feed($url, $cat_id = 0,
+       static function getFeedIcon($id) {
+       static function getFeedTitle($id, $cat = false) {
+       static function getCategoryUnread($cat, $owner_uid = false) {
+       static function getCategoryChildrenUnread($cat, $owner_uid = false) {
2017-05-04 14:50:56 +03:00
Andrew Dolgov 9549e33c2c move some common control-generating functions to controls.php 2017-05-04 14:22:23 +03:00
Andrew Dolgov 7b55001eee fix various issues reported by static analysis
update gitlab-ci config
2017-04-26 15:29:22 +03:00
Andrew Dolgov 337535416f filter by search results while marking feed as read 2017-03-31 11:21:35 +03:00
Andrew Dolgov 1bfe1d7b31 simplify error handling
* less convoluted exception dialogs
* use window.onerror for the majority of exception catching/reporting
* remove most of now useless try/catch blocks
* report stacktrace instead of manually specified error locations
2017-03-04 14:34:44 +03:00
Andrew Dolgov dc8bd8a640 add some print_checkbox/print_button calls; rename some plugin preference pane titles 2017-02-10 14:57:25 +03:00
Andrew Dolgov 8cf37284e7 af_zz_imgproxy: add optional setting to proxy all remote images
functions: add some form helper methods
2017-02-10 14:17:18 +03:00
Andrew Dolgov 24c7e4132d subscribe dialog: do not report errors via alert()
fetch_file_contents: reset all globals on start, return error message body when not using curl
subscribe_to_feed: report if cloudflare is in the error message
2017-01-28 12:45:49 +03:00
Andrew Dolgov e934d63e0c fetch_file_contents: rework the way shim works to prevent intermittent warnings 2017-01-24 15:11:13 +03:00
Andrew Dolgov 70c5b2bfcc feed tree: only run animation for appearing unread counters to prevent clashes with aux counter updating and animations ending up in wrong state 2017-01-22 20:20:35 +03:00
JustAMacUser fabfb9fc2a Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION. 2017-01-22 02:12:09 -05:00
Anders Kaseorg 5ddc3e274d lib: Upgrade php-publisher from ??? to a5d6a0e (2016-11-15)
https://github.com/pubsubhubbub/php-publisher

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2017-01-21 15:01:14 -05:00
Andrew Dolgov 17a8e61d2a deprecate encrypted feed passwords because mcrypt is getting removed from php 7.1
1. transparent decryption for existing installs stays for the time being
2. new passwords are not going to be encrypted even if FEED_CRYPT_KEY is defined
3. added update.php --decrypt-feeds to bulk decrypt existing encrypted passwords
4. updated install to not auto-generate crypt key
5. added warning to config.php-dist
2017-01-07 14:25:46 +03:00
Andrew Dolgov 3bba9c396f fetch_file_contents: set timeout when not using CURL 2016-10-24 16:12:18 +03:00
John Brayton 401eb0f694 Specify feed_id as an int rather than a string. 2016-08-28 20:08:37 -04:00
John Brayton f1b3b3f330 Add feed_id to subscribeToFeed response when the code is 1 or 0.
Set the API_LEVEL to 14.
2016-08-27 10:29:25 -04:00
Andrew Dolgov 5cbd1fe8e4 perform housekeeping tasks for plugins loaded in user-context only 2016-08-11 15:01:01 +03:00
Andrew Dolgov e6905f7f87 test if mb_internal_encoding() is available in functions.php head 2016-07-07 10:02:55 +03:00
Andrew Dolgov c71add385d fetch_file_contents: fix shim when invoked with 1 argument only 2016-03-31 09:48:05 +03:00
Andrew Dolgov 465fb16d33 remove fetch_file_contents2, use a compat shim instead 2016-03-30 13:46:32 +03:00
Andrew Dolgov e3bc4591af add a hash-based fetch_file_contents2() 2016-03-30 13:25:32 +03:00
Andrew Dolgov cc43e19b44 error handler: do not log last query, truncate error message to a smaller length 2016-02-17 16:42:13 +03:00
Andrew Dolgov 312742db6e updates: auto-disable CURL if open_basedir is enabled, notify possible issues w/ plugins 2016-01-13 18:12:31 +03:00
Andrew Dolgov a956648502 catchup_feed: proper fix for mysql 5.7 2015-12-07 20:07:13 +03:00
Andrew Dolgov 15c0bca0e5 catchup maybe add workaround for mysql 5.7 derived_merge 2015-12-03 15:33:36 +03:00
Andrew Dolgov 4c46702672 drop support for (obsolete, removed from recent php versions) php safe_mode setting
remove ugly hacks for curl + open_basedir combination breaking support for http redirects
2015-11-19 20:05:17 +03:00
Andrew Dolgov 6497fb65b4 fix ttrss_feeds.last_update defaulting to 0 on mysql, set to null instead
bump schema
2015-11-18 14:33:47 +03:00
Andrew Dolgov 7475580b37 getLabelCounters: stricter ownership check 2015-11-02 14:22:37 +03:00
Andrew Dolgov d5eaaa0508 curl: let's verify ssl peers 2015-08-17 07:53:50 +03:00
Andrew Dolgov 45913edda0 fetch_file_contents: use http/1.1 when not using curl 2015-08-12 21:51:02 +03:00
Andrew Dolgov b87744534a add plugin-based filter actions (see example plugin in attic)
bump schema
2015-08-11 23:28:42 +03:00
Andrew Dolgov 6b3160cf1e purge_feed: remove obsolete postgresql queries 2015-08-06 19:28:58 +03:00
Andrew Dolgov 8f135ce3b6 bump schema 2015-08-04 13:56:31 +03:00
Andrew Dolgov 3ceb893f66 add one catchall function to make uniqids/keyhashes/etc used by tt-rss 2015-08-03 19:21:06 +03:00
Andrew Dolgov 97aa917c6d smart_date_time: better eta_min handling 2015-07-18 00:01:37 +03:00
Andrew Dolgov 7680d44ef2 purge_orphans: optimize the query, maybe
https://tt-rss.org/forum/viewtopic.php?f=1&t=3417&p=20408#p20407
2015-07-15 13:29:03 +03:00
Andrew Dolgov a950fbecb5 Revert "Performance breakthrough"
This reverts commit c291685654.
2015-07-15 08:32:57 +03:00
GregThib c291685654 Performance breakthrough
Improvement in the Purge method for huge performance increase.
"WHERE ref_id IS NOT NULL" is needed by pgsql, not necessarily by mysql.
This is a more standard way to make deletions based on propagation (from ttrss_user_entries) with 1-to-N relations.
2015-07-13 12:03:50 +02:00
Andrew Dolgov b6714c77d2 limit smart_date_time stuff to headlines only 2015-07-03 23:36:47 +03:00
Andrew Dolgov 46973af5df smart_date_time: add special case when article date is within current hour 2015-07-03 23:25:47 +03:00
Andrew Dolgov 3318d32410 move language detection to a plugin, remove config.php constant 2015-06-19 10:12:47 +03:00
Andrew Dolgov 6022776dac speedup feed subscription process 2015-06-17 23:11:47 +03:00
Andrew Dolgov 51faa1150c add bg_BG entry to get_translations() 2015-03-11 15:36:45 +03:00
Andrew Dolgov d498b60c6d do not subscribe new users to now obsolete releases feed 2015-02-01 22:11:06 +03:00
Anders Kaseorg bd40827b73 Drop duplicate database indexes
These duplicate indexes were found by the pt-duplicate-key-checker
tool in percona-toolkit.  Duplicate indexes waste space and slow down
the query planner.  Closes #835.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2014-12-18 02:50:03 -05:00
Andrew Dolgov 584411fee6 disable libxml entity loader to prevent attacks via xml external entities (fixes #833) 2014-12-08 14:49:54 +03:00
Andrew Dolgov 9fd581336e fetch_file_contents: support retarded schema-less urls
af_comics_dilbert: fix for new dilbert.com shenanigans
2014-12-03 22:43:25 +03:00
Andrew Dolgov 229a871be7 do not force sslversion in any cases 2014-10-16 09:01:23 +04:00
Dave Zaikos 32703cc636 Added ltrim to in fetch_file_contents to fix edge cases where a URL has one or more spaces before it, which causes CURL to fail. 2014-08-22 16:44:20 -04:00
Andrew Dolgov 8ef0ca2fa6 remove unused format_libxml_error 2014-08-20 12:31:10 +04:00
Andrew Dolgov fafac207c5 geturl: if head request is denied because host is still living in 20th century, try requesting body (thanks to incompetent admins of arxiv.org) 2014-08-20 12:01:41 +04:00
Andrew Dolgov ca6ef93259 mention english language name for Arabic 2014-08-14 12:09:16 +04:00
Andrew Dolgov c4794f39c9 Merge branch 'master' of git://github.com/asalthobaity/Tiny-Tiny-RSS into asalthobaity-master 2014-08-14 12:07:20 +04:00
asalthobaity df7419cdec Arabic translation
Revised Arabic translation and inclusion of locale in get_translations()
2014-08-14 05:16:56 +03:00
Andrew Dolgov cf0231f9d1 stored http error text in curl mode 2014-08-12 19:36:45 +04:00
Andrew Dolgov 0d703c73bd reinstate wrongfully renamed archived feed; properly fix prefs filtertree labels for all feeds (ff5cc7d7) 2014-08-01 13:16:26 +04:00
Felix Eckhofer 06c4c9ebae Update schema for size support of enclosures 2014-07-15 15:05:08 +02:00
Andrew Dolgov 1fa5c5409d catchup_feed: only mark articles as read with non-negative score in fresh feed 2014-06-10 11:39:17 +04:00
Andrew Dolgov 1f16ede01d Revert "Revert "fix unicode problem from vim""
This reverts commit 0172de4244.
2014-06-03 04:56:49 +00:00
Andrew Dolgov c2aa0593bb Revert "Revert "include new lang codes""
This reverts commit df13793f1c.
2014-06-03 04:56:40 +00:00
Andrew Dolgov df13793f1c Revert "include new lang codes"
This reverts commit e385861ca5.
2014-06-03 04:53:26 +00:00
Andrew Dolgov 0172de4244 Revert "fix unicode problem from vim"
This reverts commit f33e373e59.
2014-06-03 04:53:18 +00:00
brendan braybrook f33e373e59 fix unicode problem from vim 2014-06-02 18:40:29 +00:00
brendan braybrook e385861ca5 include new lang codes 2014-06-02 17:37:08 +00:00
wltb 01465325b4 Add subscribe hook, give more information to fetch_feed hook 2014-05-19 14:06:52 +02:00
Andrew Dolgov 1fd733c8ff fetch_file_contents: do not set referrer when using curl 2014-05-09 11:33:21 +00:00
Andrew Dolgov 8067dc8ca5 bump schema version to fix resetpass_token created as a wrong type in 124 2014-04-06 13:40:16 +00:00
Andrew Dolgov 50e04efdc8 expand filtertree display to make filters easier to distinguish 2014-04-02 08:15:33 +00:00
Andrew Dolgov 1c776ade2a add pt_PT language 2014-03-21 15:56:26 +04:00
Andrew Dolgov ff5cc7d763 Revert "Update functions.php"
This reverts commit d8cdb08f78.
2014-03-21 15:55:28 +04:00
Duarte Velez Grilo d8cdb08f78 Update functions.php
Added new entry for pt_PT as requested. Thanks!
2014-03-21 12:46:05 +01:00
Andrew Dolgov 3b19a53acf schema: add resetpass_token (bump schema) 2014-03-09 10:50:32 +04:00
Andrew Dolgov cacc187732 sanity_check: ERRORS was not imported from global scope 2014-03-05 16:57:57 +04:00