XF 2.0 Is \XF::generateRandomString() guaranteed to return AlphaNumeric Codes only?

Sadik B

Well-known member
What are all the possible characters which generateRandomString() can return? Can it contain special characters other than _-

Thanks
 
PHP:
    public static function getRandomString($length)
    {
        $random = self::getRandomBytes($length);
        $string = strtr(base64_encode($random), [
            '=' => '',
            "\r" => '',
            "\n" => '',
            '+' => '-',
            '/' => '_'
        ]);

        return substr($string, 0, $length);
    }
nope.
 
Back
Top Bottom