From: Adam Magness Date: Thu, 8 Nov 2018 15:22:20 +0000 (-0500) Subject: autoname calls X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b99925060aa7bbe3278156e20eae6990dc9dd920;p=friendica.git autoname calls implement getRandomName function --- diff --git a/mod/lostpass.php b/mod/lostpass.php index f4ee91efa1..8fcdd9aae6 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -31,7 +31,7 @@ function lostpass_post(App $a) $a->internalRedirect(); } - $pwdreset_token = autoname(12) . mt_rand(1000, 9999); + $pwdreset_token = Strings::getRandomName(12) . mt_rand(1000, 9999); $fields = [ 'pwdreset' => $pwdreset_token, diff --git a/src/Core/Installer.php b/src/Core/Installer.php index d2b5c4f055..9dd338e2c5 100644 --- a/src/Core/Installer.php +++ b/src/Core/Installer.php @@ -11,6 +11,7 @@ use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\Object\Image; use Friendica\Util\Network; +use Friendica\Util\Strings; /** * Contains methods for installation purpose of Friendica @@ -264,7 +265,7 @@ class Installer } if ($passed2) { - $str = autoname(8); + $str = Strings::getRandomName(8); $cmd = "$phppath util/testargs.php $str"; $result = trim(shell_exec($cmd)); $passed3 = $result == $str; diff --git a/src/Model/Register.php b/src/Model/Register.php index 5311c80c26..66f19133b8 100644 --- a/src/Model/Register.php +++ b/src/Model/Register.php @@ -78,7 +78,7 @@ class Register */ public static function createForInvitation() { - $code = autoname(8) . srand(1000, 9999); + $code = Strings::getRandomName(8) . srand(1000, 9999); $fields = [ 'hash' => $code, diff --git a/src/Model/User.php b/src/Model/User.php index e52ff319dd..187708eb79 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -270,7 +270,7 @@ class User */ public static function generateNewPassword() { - return autoname(6) . mt_rand(100, 9999); + return Strings::getRandomName(6) . mt_rand(100, 9999); } /** diff --git a/src/Util/Strings.php b/src/Util/Strings.php index bf31f62fa0..07acb4586d 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -68,7 +68,7 @@ class Strings * * @return string */ - public static function getRandomName($len) // autoname() + public static function getRandomName($len) { if ($len <= 0) { return '';