aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/javascriptController.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-03-21 18:57:57 +0100
committerGravatar GitHub <noreply@github.com> 2023-03-21 18:57:57 +0100
commit247215ffaa2966919115f283fb67a0096df8dc1c (patch)
tree16ff9d0ec502bd95f0a1e2d6b49f853cf963e804 /app/Controllers/javascriptController.php
parente679d3df0e55530c056d701b4773ff7e74f5c82c (diff)
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>
Diffstat (limited to 'app/Controllers/javascriptController.php')
-rw-r--r--app/Controllers/javascriptController.php9
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());
}