PHP 5.2 compatibility

https://github.com/FreshRSS/FreshRSS/pull/1016
https://github.com/FreshRSS/FreshRSS/issues/1015
It is first PHP 5.5 that added support for accessing characters within
string literals using []...
This commit is contained in:
Alexandre Alapetite
2015-10-26 17:38:32 +01:00
parent ad1f0cb96b
commit c992b683a8

View File

@@ -45,8 +45,9 @@ class FreshRSS_javascript_Controller extends Minz_ActionController {
}
//Failure: Return random data.
$this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_user_Controller::BCRYPT_COST);
$alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 22; $i > 0; $i--) {
$this->view->salt1 .= './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'[rand(0, 63)];
$this->view->salt1 .= $alphabet[rand(0, 63)];
}
$this->view->nonce = sha1(rand());
}