mcrypt_create_iv deprecated in PHP 7.1.0

Issue #339 duplicate
Former user created an issue

should be updated to

// generate CSRF token 
if (empty($_SESSION['token']))
{
    if (function_exists('random_bytes'))
    {
        $_SESSION['token'] = bin2hex(random_bytes(32));
    } elseif (function_exists('mcrypt_create_iv'))
    {
        $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
    } else {
        $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
    }
}

Comments (3)

  1. phpLiteAdmin repo owner

    Another duplicate of #337 Please use the search before posting issues. This change is already in git and the development version.

  2. Log in to comment