]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
deprecate encrypted feed passwords because mcrypt is getting removed from php 7.1
[tt-rss.git] / include / functions.php
index 68f6f592bdd6afd349dc82d231eb603f786185ac..ce7627d5a77cd859600304b989c359a4b50e651e 100755 (executable)
                                }
                        }
 
+                       // TODO: should this support POST requests or not? idk
+
                        if (!$post_query && $timestamp) {
                                 $context = stream_context_create(array(
                                          'http' => array(
                                                        'method' => 'GET',
+                                                   'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
                                                        'protocol_version'=> 1.1,
                                                        'header' => "If-Modified-Since: ".gmdate("D, d M Y H:i:s \\G\\M\\T\r\n", $timestamp)
                                          )));
                                 $context = stream_context_create(array(
                                          'http' => array(
                                                        'method' => 'GET',
+                                                   'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
                                                        'protocol_version'=> 1.1
                                          )));
                        }
                        "SELECT id FROM ttrss_feeds
                        WHERE feed_url = '$url' AND owner_uid = ".$_SESSION["uid"]);
 
-               if (strlen(FEED_CRYPT_KEY) > 0) {
-                       require_once "crypt.php";
-                       $auth_pass = substr(encrypt_string($auth_pass), 0, 250);
-                       $auth_pass_encrypted = 'true';
-               } else {
-                       $auth_pass_encrypted = 'false';
-               }
-
+               $auth_pass_encrypted = 'false';
                $auth_pass = db_escape_string($auth_pass);
 
                if (db_num_rows($result) == 0) {
                                set_basic_feed_info($feed_id);
                        }
 
-                       return array("code" => 1, "feed_id" => $feed_id);
+                       return array("code" => 1, "feed_id" => (int) $feed_id);
                } else {
-                       return array("code" => 0, "feed_id" => db_fetch_result($result, 0, "id"));
+                       return array("code" => 0, "feed_id" => (int) db_fetch_result($result, 0, "id"));
                }
        }