Просмотр исходного кода

Initial support for PHP 8.2 (#4421)

* Initial support for PHP 8.2
Using dev image `freshrss/freshrss:latest` https://github.com/FreshRSS/FreshRSS/pull/4420

* Deprecated string interpolation
Alexandre Alapetite 3 лет назад
Родитель
Сommit
dcc77ee343
4 измененных файлов с 5 добавлено и 5 удалено
  1. 2 0
      app/Models/View.php
  2. 1 1
      app/layout/layout.phtml
  3. 1 3
      app/layout/simple.phtml
  4. 1 1
      lib/Minz/ActionException.php

+ 2 - 0
app/Models/View.php

@@ -23,6 +23,8 @@ class FreshRSS_View extends Minz_View {
 	/** @var int */
 	/** @var int */
 	public $nbUnreadTags;
 	public $nbUnreadTags;
 	public $tags;
 	public $tags;
+	/** @var array<string,string> */
+	public $notification;
 
 
 	// Substriptions
 	// Substriptions
 	public $default_category;
 	public $default_category;

+ 1 - 1
app/layout/layout.phtml

@@ -66,7 +66,7 @@ if (_t('gen.dir') === 'rtl') {
 <?php
 <?php
 	$msg = '';
 	$msg = '';
 	$status = 'closed';
 	$status = 'closed';
-	if (isset($this->notification)) {
+	if (!empty($this->notification)) {
 		$msg = $this->notification['content'];
 		$msg = $this->notification['content'];
 		$status = $this->notification['type'];
 		$status = $this->notification['type'];
 
 

+ 1 - 3
app/layout/simple.phtml

@@ -46,7 +46,6 @@
 			<?php if (FreshRSS_Auth::accessNeedsAction()) { ?>
 			<?php if (FreshRSS_Auth::accessNeedsAction()) { ?>
 				<a class="signout" href="<?= _url('auth', 'logout') ?>">
 				<a class="signout" href="<?= _url('auth', 'logout') ?>">
 					<?= _i('logout') . _t('gen.auth.logout') ?>
 					<?= _i('logout') . _t('gen.auth.logout') ?>
-
 					(<?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>)
 					(<?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>)
 				</a>
 				</a>
 			<?php } ?>
 			<?php } ?>
@@ -59,10 +58,9 @@
 <?php
 <?php
 	$msg = '';
 	$msg = '';
 	$status = 'closed';
 	$status = 'closed';
-	if (isset($this->notification)) {
+	if (!empty($this->notification)) {
 		$msg = $this->notification['content'];
 		$msg = $this->notification['content'];
 		$status = $this->notification['type'];
 		$status = $this->notification['type'];
-
 		invalidateHttpCache();
 		invalidateHttpCache();
 	}
 	}
 ?>
 ?>

+ 1 - 1
lib/Minz/ActionException.php

@@ -4,7 +4,7 @@ class Minz_ActionException extends Minz_Exception {
 		// Just for security, as we are not supposed to get non-alphanumeric characters.
 		// Just for security, as we are not supposed to get non-alphanumeric characters.
 		$action_name = rawurlencode($action_name);
 		$action_name = rawurlencode($action_name);
 
 
-		$message = "Invalid action name “${action_name}” for controller “${controller_name}”.";
+		$message = "Invalid action name “{$action_name}” for controller “{$controller_name}”.";
 		parent::__construct ($message, $code);
 		parent::__construct ($message, $code);
 	}
 	}
 }
 }