Tweak the 'Feeds::_get_title()' param order to make PHP happy.

Required params need to go before optional.
This commit is contained in:
wn_
2025-08-29 12:27:44 +00:00
parent fd5ce90efe
commit ecef0ae951
6 changed files with 13 additions and 13 deletions

View File

@@ -574,7 +574,7 @@ class API extends Handler {
$unread = Feeds::_get_counters($i, false, true);
if ($unread || !$unread_only) {
$title = Feeds::_get_title($i, false, $_SESSION['uid']);
$title = Feeds::_get_title($i, $_SESSION['uid']);
$row = [
'id' => $i,

View File

@@ -677,7 +677,7 @@ class Feeds extends Handler_Protected {
</script>
<div class="container">
<h1>Feed Debugger: <?= "$feed_id: " . $this->_get_title($feed_id, false, $_SESSION['uid']) ?></h1>
<h1>Feed Debugger: <?= "$feed_id: " . $this->_get_title($feed_id, $_SESSION['uid']) ?></h1>
<div class="content">
<form method="post" action="" dojoType="dijit.form.Form">
<?= \Controls\hidden_tag("op", "Feeds") ?>
@@ -1178,7 +1178,7 @@ class Feeds extends Handler_Protected {
}
}
static function _get_title(int|string $id, bool $cat = false, int $owner_uid): string {
static function _get_title(int|string $id, int $owner_uid, bool $cat = false): string {
if ($cat) {
return self::_get_cat_title($id, $owner_uid);
} else if ($id == Feeds::FEED_STARRED) {
@@ -1638,7 +1638,7 @@ class Feeds extends Handler_Protected {
$last_error = $row["last_error"];
$last_updated = $row["last_updated"];
} else {
$feed_title = self::_get_title($feed, false, $owner_uid);
$feed_title = self::_get_title($feed, $owner_uid);
}
}
}

View File

@@ -182,8 +182,8 @@ class OPML extends Handler_Protected {
if ($cat_filter && $tmp_line["cat_id"] || $tmp_line["feed_id"]) {
$tmp_line["feed"] = Feeds::_get_title(
$cat_filter ? $tmp_line["cat_id"] : $tmp_line["feed_id"],
$cat_filter,
$_SESSION['uid']);
$_SESSION['uid'],
$cat_filter);
} else {
$tmp_line["feed"] = "";
}
@@ -200,7 +200,7 @@ class OPML extends Handler_Protected {
}
} else {
if ($feed_id) {
array_push($match, [Feeds::_get_title((int)$feed_id, false, $owner_uid), false, false]);
array_push($match, [Feeds::_get_title((int)$feed_id, $owner_uid), false, false]);
} else {
array_push($match, [0, false, true]);
}

View File

@@ -1115,7 +1115,7 @@ class Pref_Feeds extends Handler_Protected {
*/
private function feedlist_init_feed(int $feed_id, ?string $title = null, bool $unread = false, string $error = '', string $updated = ''): array {
if (!$title)
$title = Feeds::_get_title($feed_id, false, $_SESSION['uid']);
$title = Feeds::_get_title($feed_id, $_SESSION['uid']);
if ($unread === false)
$unread = Feeds::_get_counters($feed_id, false, true);
@@ -1284,7 +1284,7 @@ class Pref_Feeds extends Handler_Protected {
]);
print json_encode([
"title" => Feeds::_get_title($feed_id, $is_cat, $_SESSION['uid']),
"title" => Feeds::_get_title($feed_id, $_SESSION['uid'], $is_cat),
"link" => $link
]);
}

View File

@@ -264,7 +264,7 @@ class Pref_Filters extends Handler_Protected {
array_push($feeds_fmt, Feeds::_get_cat_title($feed_id, $_SESSION['uid']));
} else {
if ($feed_id)
array_push($feeds_fmt, Feeds::_get_title((int)$feed_id, false, $_SESSION['uid']));
array_push($feeds_fmt, Feeds::_get_title((int)$feed_id, $_SESSION['uid']));
else
array_push($feeds_fmt, __("All feeds"));
}
@@ -276,7 +276,7 @@ class Pref_Filters extends Handler_Protected {
$where = $rule->cat_filter ?
Feeds::_get_cat_title($rule->cat_id ?? 0, $_SESSION['uid']) :
($rule->feed_id ?
Feeds::_get_title($rule->feed_id, false, $_SESSION['uid']) : __("All feeds"));
Feeds::_get_title($rule->feed_id, $_SESSION['uid']) : __("All feeds"));
}
$inverse_class = $rule->inverse ? "inverse" : "";
@@ -463,7 +463,7 @@ class Pref_Filters extends Handler_Protected {
array_push($feeds_fmt, Feeds::_get_cat_title($feed_id, $_SESSION['uid']));
} else {
if ($feed_id)
array_push($feeds_fmt, Feeds::_get_title((int)$feed_id, false, $_SESSION['uid']));
array_push($feeds_fmt, Feeds::_get_title((int)$feed_id, $_SESSION['uid']));
else
array_push($feeds_fmt, __("All feeds"));
}

View File

@@ -210,7 +210,7 @@ class Af_Psql_Trgm extends Plugin {
<li>
<i class='material-icons'>rss_feed</i>
<a href='#' onclick="CommonDialogs.editFeed(<?= $f ?>)">
<?= Feeds::_get_title($f, false, $_SESSION['uid']) ?>
<?= Feeds::_get_title($f, $_SESSION['uid']) ?>
</a>
</li>
<?php } ?>