mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 10:25:56 +00:00
allow subscribing to twitter feeds without oauth (if require auth checkbox is unset)
This commit is contained in:
@@ -1843,14 +1843,6 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribes the user to the given feed
|
||||
*
|
||||
* @param resource $link Database connection
|
||||
* @param string $url Feed URL to subscribe to
|
||||
* @param integer $cat_id Category ID the feed shall be added to
|
||||
* @param string $auth_login (optional) Feed username
|
||||
* @param string $auth_pass (optional) Feed password
|
||||
*
|
||||
* @return integer Status code:
|
||||
* 0 - OK, Feed already exists
|
||||
* 1 - OK, Feed added
|
||||
@@ -1862,7 +1854,7 @@
|
||||
* 5 - Couldn't download the URL content.
|
||||
*/
|
||||
function subscribe_to_feed($link, $url, $cat_id = 0,
|
||||
$auth_login = '', $auth_pass = '') {
|
||||
$auth_login = '', $auth_pass = '', $need_auth = false) {
|
||||
|
||||
require_once "include/rssfuncs.php";
|
||||
|
||||
@@ -1877,7 +1869,7 @@
|
||||
|
||||
$has_oauth = db_fetch_result($result, 0, 'twitter_oauth');
|
||||
|
||||
if (!$has_oauth || strpos($url, '://api.twitter.com') === false) {
|
||||
if (!$need_auth || !$has_oauth || strpos($url, '://api.twitter.com') === false) {
|
||||
if (!fetch_file_contents($url, false, $auth_login, $auth_pass)) return 5;
|
||||
|
||||
if (url_is_html($url, $auth_login, $auth_pass)) {
|
||||
|
||||
Reference in New Issue
Block a user