]> git.wh0rd.org Git - tt-rss.git/commitdiff
remove unnecessary wrapping from share uniqid() keys
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 24 Dec 2013 09:27:57 +0000 (13:27 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 24 Dec 2013 09:27:57 +0000 (13:27 +0400)
classes/pref/feeds.php
include/functions.php
plugins/instances/init.php
plugins/share/init.php

index 122d4b116ef26245fc37cbe36bdab8d0ecabfc84..05c2b229e40e2d9cb0ecf9d4d36d9bc9794b8559 100644 (file)
@@ -1891,7 +1891,7 @@ class Pref_Feeds extends Handler_Protected {
                        AND owner_uid = " . $owner_uid);
 
                if ($this->dbh->num_rows($result) == 1) {
-                       $key = $this->dbh->escape_string(sha1(uniqid(rand(), true)));
+                       $key = $this->dbh->escape_string(uniqid());
 
                        $this->dbh->query("UPDATE ttrss_access_keys SET access_key = '$key'
                                WHERE feed_id = '$feed_id' AND is_cat = $sql_is_cat
index cf9b0510ffa9976757e9e527ca9405eb37ce5e30..a64f0978a64dbf9ca01c7e557a1f419e999d8007 100644 (file)
@@ -80,7 +80,7 @@
                                        "pt_BR" => "Portuguese/Brazil",
                                        "zh_CN" => "Simplified Chinese",
                                        "sv_SE" => "Svenska",
-                                       "fi_FI" => "Suomi",                                     
+                                       "fi_FI" => "Suomi",
                                        "tr_TR" => "Türkçe");
 
                return $tr;
 
                                $_SESSION["name"] = db_fetch_result($result, 0, "login");
                                $_SESSION["access_level"] = db_fetch_result($result, 0, "access_level");
-                               $_SESSION["csrf_token"] = sha1(uniqid(rand(), true));
+                               $_SESSION["csrf_token"] = uniqid(rand(), true);
 
                                db_query("UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
                                        $_SESSION["uid"]);
                        $_SESSION["auth_module"] = false;
 
                        if (!$_SESSION["csrf_token"]) {
-                               $_SESSION["csrf_token"] = sha1(uniqid(rand(), true));
+                               $_SESSION["csrf_token"] = uniqid(rand(), true);
                        }
 
                        $_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"];
                if (db_num_rows($result) == 1) {
                        return db_fetch_result($result, 0, "access_key");
                } else {
-                       $key = db_escape_string(sha1(uniqid(rand(), true)));
+                       $key = db_escape_string(uniqid());
 
                        $result = db_query("INSERT INTO ttrss_access_keys
                                (access_key, feed_id, is_cat, owner_uid)
index aac28196f2e18d8b727a760e7d2638e2f4c6acf8..069186ad1fa3fb2104975b16a234c8eaa72b3340 100644 (file)
@@ -407,7 +407,7 @@ class Instances extends Plugin implements IHandler {
 
                print "<hr/>";
 
-               $access_key = sha1(uniqid(rand(), true));
+               $access_key = uniqid();
 
                /* Access key */
 
@@ -439,7 +439,7 @@ class Instances extends Plugin implements IHandler {
        }
 
        function genHash() {
-               $hash = sha1(uniqid(rand(), true));
+               $hash = uniqid();
 
                print json_encode(array("hash" => $hash));
        }
index a000b8ebea2789500f615ead6097f9cb4a65fb2c..5fa9987577573344428074881974d85ce46596fb 100644 (file)
@@ -60,7 +60,7 @@ class Share extends Plugin {
        function newkey() {
                $id = db_escape_string($_REQUEST['id']);
 
-               $uuid = db_escape_string(sha1(uniqid(rand(), true)));
+               $uuid = db_escape_string(uniqid());
 
                db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$id'
                        AND owner_uid = " . $_SESSION['uid']);
@@ -91,7 +91,7 @@ class Share extends Plugin {
                        $ref_id = db_fetch_result($result, 0, "ref_id");
 
                        if (!$uuid) {
-                               $uuid = db_escape_string(sha1(uniqid(rand(), true)));
+                               $uuid = db_escape_string(uniqid());
                                db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$param'
                                        AND owner_uid = " . $_SESSION['uid']);
                        }