diff options
Diffstat (limited to 'app/Controllers/javascriptController.php')
| -rw-r--r-- | app/Controllers/javascriptController.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index b4e769738..d7c600113 100644 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -1,6 +1,7 @@ <?php class FreshRSS_javascript_Controller extends FreshRSS_ActionController { + public function firstAction(): void { $this->view->_layout(false); } @@ -25,6 +26,10 @@ class FreshRSS_javascript_Controller extends FreshRSS_ActionController { } //For Web-form login + + /** + * @throws Exception + */ public function nonceAction(): void { header('Content-Type: application/json; charset=UTF-8'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T')); @@ -32,7 +37,7 @@ class FreshRSS_javascript_Controller extends FreshRSS_ActionController { header('Cache-Control: private, no-cache, no-store, must-revalidate'); header('Pragma: no-cache'); - $user = isset($_GET['user']) ? $_GET['user'] : ''; + $user = $_GET['user'] ?? ''; if (FreshRSS_Context::initUser($user)) { try { $salt = FreshRSS_Context::$system_conf->salt; @@ -54,7 +59,7 @@ class FreshRSS_javascript_Controller extends FreshRSS_ActionController { $this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_password_Util::BCRYPT_COST); $alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; for ($i = 22; $i > 0; $i--) { - $this->view->salt1 .= $alphabet[mt_rand(0, 63)]; + $this->view->salt1 .= $alphabet[random_int(0, 63)]; } $this->view->nonce = sha1('' . mt_rand()); } |
