From ebe16f92a52fc0358d52301bb54d4dfbdf57e77c Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 18 Apr 2023 14:33:40 +0400 Subject: [PATCH] Fixed OPDS XML output for multiple filters In XML any & symbols acting as parameter separators in URL search components must be HTML-escaped. --- static/templates/catalog_v2_entries.xml | 2 +- test/library_server.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/templates/catalog_v2_entries.xml b/static/templates/catalog_v2_entries.xml index 223aae9c3..c0eb9dcc9 100644 --- a/static/templates/catalog_v2_entries.xml +++ b/static/templates/catalog_v2_entries.xml @@ -6,7 +6,7 @@ {{feed_id}} 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") " Filtered Entries (start=1&count=1)\n" " YYYY-MM-DDThh:mm:ssZ\n" " 3\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&category=jazz") " Filtered Entries (lang=fra&category=jazz)\n" " YYYY-MM-DDThh:mm:ssZ\n" " 1\n"