]> git.wh0rd.org - tt-rss.git/commitdiff
subcribe_to_feed: only try to use twitter OAuth when authentication information is...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 26 Feb 2011 12:11:20 +0000 (15:11 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 26 Feb 2011 12:11:20 +0000 (15:11 +0300)
functions.php

index 20f205bce38828929813157e72c2ec8b70e46c93..3d02d6c8b1945cfec1aa11f7156ca38ba6a1ce0b 100644 (file)
 
                $update_method = 0;
 
-               if (strpos($url, '://twitter.com') === false) {
+               $result = db_query($link, "SELECT twitter_oauth FROM ttrss_users 
+                       WHERE id = ".$_SESSION['uid']);
+
+               $has_oauth = db_fetch_result($result, 0, 'twitter_oauth');
+
+               if (!$has_oauth || strpos($url, '://twitter.com') === false) {
                        if (!fetch_file_contents($url)) return 5;
 
                        if (url_is_html($url)) {