summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorfox <[email protected]>2021-12-01 10:52:12 +0300
committerfox <[email protected]>2021-12-01 10:52:12 +0300
commita72e24343bddbee4aa2b354aabd91b55e33cd71e (patch)
treecd3134c15776e6cef62205c0e382bd2ed40d0de6 /classes
parentdf7b2e79849419fcc278c0549fdf10c094991558 (diff)
parent72e21f89ce2465fafc08a92dc2d216b55f355f28 (diff)
Merge pull request 'Fixes for php 8.1 compatibility' (#56) from magicDave/tt-rss:php8.1-fixes into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/56
Diffstat (limited to 'classes')
-rw-r--r--classes/config.php2
-rw-r--r--classes/debug.php2
-rwxr-xr-xclasses/feeditem/atom.php2
-rw-r--r--classes/feedparser.php2
-rwxr-xr-xclasses/feeds.php2
-rw-r--r--classes/pref/system.php2
-rwxr-xr-xclasses/rssutils.php2
7 files changed, 7 insertions, 7 deletions
diff --git a/classes/config.php b/classes/config.php
index 95e2dd3ac..11d2a1bb7 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -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;
diff --git a/classes/debug.php b/classes/debug.php
index e20126b86..fbdf260e0 100644
--- a/classes/debug.php
+++ b/classes/debug.php
@@ -88,7 +88,7 @@ class Debug {
if (!self::$enabled || self::$loglevel < $level) return false;
- $ts = strftime("%H:%M:%S", time());
+ $ts = date("H:i:s", time());
if (function_exists('posix_getpid')) {
$ts = "$ts/" . posix_getpid();
}
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index 36a2e91f5..cac6d8c54 100755
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -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)) {
diff --git a/classes/feedparser.php b/classes/feedparser.php
index 6ce69cc89..3821c15d8 100644
--- a/classes/feedparser.php
+++ b/classes/feedparser.php
@@ -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 */
diff --git a/classes/feeds.php b/classes/feeds.php
index a9afb70f2..ebffe3269 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -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;
diff --git a/classes/pref/system.php b/classes/pref/system.php
index 10f196b55..806291c72 100644
--- a/classes/pref/system.php
+++ b/classes/pref/system.php
@@ -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'>
diff --git a/classes/rssutils.php b/classes/rssutils.php
index b886a060c..bcf049a9b 100755
--- a/classes/rssutils.php
+++ b/classes/rssutils.php
@@ -920,7 +920,7 @@ class RSSUtils {
$entry_timestamp = time();
}
- $entry_timestamp_fmt = strftime("%Y/%m/%d %H:%M:%S", $entry_timestamp);
+ $entry_timestamp_fmt = date("Y/m/d H:i:s", $entry_timestamp);
Debug::log("date: $entry_timestamp ($entry_timestamp_fmt)", Debug::LOG_VERBOSE);
Debug::log("num_comments: $num_comments", Debug::LOG_VERBOSE);