1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 06:45:54 +00:00

various fixes vor php 8.1 compatibility

This commit is contained in:
David Edler
2021-11-30 21:50:09 +01:00
parent df7b2e7984
commit 14027ae04e
9 changed files with 34 additions and 26 deletions

View File

@@ -359,7 +359,7 @@ class Config {
if ($check == "version") {
$rv["version"] = strftime("%y.%m", (int)$timestamp) . "-$commit";
$rv["version"] = date("%y.%m", (int)$timestamp) . "-$commit";
$rv["commit"] = $commit;
$rv["timestamp"] = $timestamp;

View File

@@ -88,7 +88,7 @@ class Debug {
if (!self::$enabled || self::$loglevel < $level) return false;
$ts = strftime("%H:%M:%S", time());
$ts = date("%H:%M:%S", time());
if (function_exists('posix_getpid')) {
$ts = "$ts/" . posix_getpid();
}

View File

@@ -70,7 +70,7 @@ class FeedItem_Atom extends FeedItem_Common {
*
* @return string the rewritten XML or original $content
*/
private function rewrite_content_to_base(?string $base = null, string $content) {
private function rewrite_content_to_base(?string $base = null, ?string $content = '') {
if (!empty($base) && !empty($content)) {

View File

@@ -201,7 +201,7 @@ class FeedParser {
// libxml may have invalid unicode data in error messages
function error() : string {
return UConverter::transcode($this->error, 'UTF-8', 'UTF-8');
return UConverter::transcode($this->error ?? '', 'UTF-8', 'UTF-8');
}
/** @return array<string> - WARNING: may return invalid unicode data */

View File

@@ -23,7 +23,7 @@ class Feeds extends Handler_Protected {
*/
private function _format_headlines_list($feed, string $method, string $view_mode, int $limit, bool $cat_view,
int $offset, string $override_order, bool $include_children, ?int $check_first_id = null,
bool $skip_first_id_check, string $order_by): array {
?bool $skip_first_id_check = false, ? string $order_by = ''): array {
$disable_cache = false;

View File

@@ -138,7 +138,7 @@ class Pref_System extends Handler_Administrative {
$sth->execute($errno_values);
while ($line = $sth->fetch()) {
foreach ($line as $k => $v) { $line[$k] = htmlspecialchars($v); }
foreach ($line as $k => $v) { $line[$k] = htmlspecialchars($v ?? ''); }
?>
<tr>
<td class='errno'>