Fixed OPDS XML output for multiple filters

In XML any & symbols acting as parameter separators in URL search
components must be HTML-escaped.
This commit is contained in:
Veloman Yunkan
2023-04-18 14:33:40 +04:00
parent 4f6a5759aa
commit ebe16f92a5
2 changed files with 3 additions and 3 deletions

View File

@ -728,7 +728,7 @@ TEST_F(LibraryServerTest, catalog_v2_entries_filtered_by_range)
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?start=1&count=1");
EXPECT_EQ(r->status, 200);
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
CATALOG_V2_ENTRIES_PREAMBLE("?start=1&count=1")
CATALOG_V2_ENTRIES_PREAMBLE("?start=1&count=1")
" <title>Filtered Entries (start=1&amp;count=1)</title>\n"
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
" <totalResults>3</totalResults>\n"
@ -799,7 +799,7 @@ TEST_F(LibraryServerTest, catalog_v2_entries_multiple_filters)
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?lang=fra&category=jazz");
EXPECT_EQ(r->status, 200);
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
CATALOG_V2_ENTRIES_PREAMBLE("?lang=fra&category=jazz")
CATALOG_V2_ENTRIES_PREAMBLE("?lang=fra&amp;category=jazz")
" <title>Filtered Entries (lang=fra&amp;category=jazz)</title>\n"
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
" <totalResults>1</totalResults>\n"