Fix error when we can not generate random string

Fixes #12056

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-03-01 15:35:46 +01:00
parent 8eee22be3a
commit a6b3a9ce51
2 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,7 @@ phpMyAdmin - ChangeLog
- issue #11907 Avoid displaying UPDATE query twice
- issue #11850 Fixed CSV import
- issue Fix SQL syntax highlighting in database search page
- issue #12056 Fix error when we can not generate random string
4.5.5.1 (not yet released)
- issue #11971 CREATE UNIQUE INDEX index type is not recognized by parser.

View File

@ -117,5 +117,13 @@ if (! isset($_SESSION[' PMA_token '])) {
$_SESSION[' PMA_token '] = bin2hex(openssl_random_pseudo_bytes(16));
}
}
/**
* Check if token is properly generated (both above functions can return false).
*/
if (empty($_SESSION[' PMA_token '])) {
PMA_fatalError(
'Failed to generate random CSRF token!'
);
}
require_once 'libraries/session.lib.php';