aboutsummaryrefslogtreecommitdiff
path: root/formats/HtmlFormat.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2024-01-25 16:06:24 +0100
committerGravatar GitHub <noreply@github.com> 2024-01-25 16:06:24 +0100
commitd08d13f2c87b24fadb92e31c50dedc6e56c3c088 (patch)
treea2fd66aa0cdd091ad34a135cf8222847f025f6f3 /formats/HtmlFormat.php
parent9574c17ddc4c55ab191878164627c4501a565221 (diff)
downloadrss-bridge-d08d13f2c87b24fadb92e31c50dedc6e56c3c088.tar.gz
rss-bridge-d08d13f2c87b24fadb92e31c50dedc6e56c3c088.tar.zst
rss-bridge-d08d13f2c87b24fadb92e31c50dedc6e56c3c088.zip
refactor: introduce http Request object (#3926)
Diffstat (limited to 'formats/HtmlFormat.php')
-rw-r--r--formats/HtmlFormat.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php
index ef66f493..93c824b3 100644
--- a/formats/HtmlFormat.php
+++ b/formats/HtmlFormat.php
@@ -12,20 +12,21 @@ class HtmlFormat extends FormatAbstract
$formatFactory = new FormatFactory();
$buttons = [];
$linkTags = [];
- foreach ($formatFactory->getFormatNames() as $format) {
+ foreach ($formatFactory->getFormatNames() as $formatName) {
// Dynamically build buttons for all formats (except HTML)
- if ($format === 'Html') {
+ if ($formatName === 'Html') {
continue;
}
- $formatUrl = '?' . str_ireplace('format=Html', 'format=' . $format, htmlentities($queryString));
+ $formatUrl = '?' . str_ireplace('format=Html', 'format=' . $formatName, htmlentities($queryString));
$buttons[] = [
'href' => $formatUrl,
- 'value' => $format,
+ 'value' => $formatName,
];
+ $format = $formatFactory->create($formatName);
$linkTags[] = [
'href' => $formatUrl,
- 'title' => $format,
- 'type' => $formatFactory->create($format)->getMimeType(),
+ 'title' => $formatName,
+ 'type' => $format->getMimeType(),
];
}