URL encode paths in desktop notifications

This commit is contained in:
Robbert van der Helm
2021-07-11 17:18:45 +02:00
parent 83951200bb
commit d7dc0529a8
+7 -7
View File
@@ -416,13 +416,13 @@ bool send_notification(const std::string& title,
if (append_origin) { if (append_origin) {
try { try {
const fs::path this_library = get_this_file_location(); const fs::path this_library = get_this_file_location();
formatted_body formatted_body << "\n"
<< "\n" << "Source: <a href=\"file://"
<< "Source: <a href=\"file://" << url_encode_path(
// TODO: This should be URL encoded, but let's just pray that this_library.parent_path().string())
// noone uses double quotes in their plugin names << "\">"
<< this_library.parent_path().string() << "\">" << xml_escape(this_library.filename().string())
<< xml_escape(this_library.filename().string()) << "</a>"; << "</a>";
} catch (const boost::system::system_error&) { } catch (const boost::system::system_error&) {
// I don't think this can fail in the way we're using it, but the // I don't think this can fail in the way we're using it, but the
// last thing we want is our notification informing the user of an // last thing we want is our notification informing the user of an