From 7f900007c75a4c2da6dfd8e2aa4a8dc29a23e3a6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 25 Nov 2017 21:31:10 -0500 Subject: [PATCH] Simplify random_string() calls --- ifttt/ifttt.php | 2 +- xmpp/xmpp.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 800294ff..384b955c 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -45,7 +45,7 @@ function ifttt_settings(App $a, &$s) $key = PConfig::get(local_user(), 'ifttt', 'key'); if (!$key) { - $key = substr(random_string(),0,20); + $key = random_string(20); PConfig::set(local_user(), 'ifttt', 'key', $key); } diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index 867a3c06..e523c65c 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -94,7 +94,7 @@ function xmpp_plugin_settings(App $a, &$s) function xmpp_login() { if (!$_SESSION["allow_api"]) { - $password = substr(random_string(),0,16); + $password = random_string(16); PConfig::set(local_user(), "xmpp", "password", $password); } }