Przeglądaj źródła

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 []...
Alexandre Alapetite 10 lat temu
rodzic
commit
c992b683a8
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      app/Controllers/javascriptController.php

+ 2 - 1
app/Controllers/javascriptController.php

@@ -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());
 	}