Typehint some Controllers (#5106)

* Typehint to Controllers

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
This commit is contained in:
Luc SANCHEZ
2023-03-21 18:57:57 +01:00
committed by GitHub
parent e679d3df0e
commit 247215ffaa
11 changed files with 122 additions and 97 deletions

View File

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