summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-08-03 19:21:06 +0300
committerAndrew Dolgov <[email protected]>2015-08-03 19:21:06 +0300
commit3ceb893f66920383b0f79faf1fc896469ee3d2a4 (patch)
tree27a9601fe635af1c4410133edbe141574bf389d6 /include/functions.php
parente053fd8d6bd02ea1943b61f3ace5396845c2d1db (diff)
add one catchall function to make uniqids/keyhashes/etc used by tt-rss
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index c27455220..cecfaeada 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -738,7 +738,7 @@
$_SESSION["name"] = db_fetch_result($result, 0, "login");
$_SESSION["access_level"] = db_fetch_result($result, 0, "access_level");
- $_SESSION["csrf_token"] = uniqid(rand(), true);
+ $_SESSION["csrf_token"] = uniqid_short();
db_query("UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
$_SESSION["uid"]);
@@ -768,7 +768,7 @@
$_SESSION["auth_module"] = false;
if (!$_SESSION["csrf_token"]) {
- $_SESSION["csrf_token"] = uniqid(rand(), true);
+ $_SESSION["csrf_token"] = uniqid_short();
}
$_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"];
@@ -1996,6 +1996,10 @@
}
}
+ function uniqid_short() {
+ return uniqid(base_convert(rand(), 10, 36));
+ }
+
// TODO: less dumb splitting
require_once "functions2.php";