From 820d1b8e17be40b32c899b86858575dccdffc23a Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 22 Apr 2019 12:20:44 +0200 Subject: [PATCH] Escape & in URLs. --- CMakeLists.txt | 2 +- gitea2rss.1.adoc | 2 +- src/write.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f7d3f0..a379da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(gitea2rss - VERSION 0.4.3 + VERSION 0.4.4 LANGUAGES CXX ) diff --git a/gitea2rss.1.adoc b/gitea2rss.1.adoc index fc07d13..88a8862 100644 --- a/gitea2rss.1.adoc +++ b/gitea2rss.1.adoc @@ -51,7 +51,7 @@ this in it: href="https://rss.example.com/?repo={{.Repository.Owner.Name}}/{{.Repository.Name}}"/> + href="https://rss.example.com/?repo={{.Repository.Owner.Name}}/{{.Repository.Name}}&type=tags"/> {{end}} ---- diff --git a/src/write.cpp b/src/write.cpp index 2c7d078..6baeeaf 100644 --- a/src/write.cpp +++ b/src/write.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include "version.hpp" #include "gitea2rss.hpp" @@ -58,6 +59,7 @@ void write_preamble(const string &url, const string &type) selfurl = "http://"; } selfurl += string(server_name) + request_uri; + selfurl = std::regex_replace(selfurl, std::regex("&"), "&"); } cout << "\n"