Sanitize URLs in podbeuter too.

Reported by:	tj <tj@mrsk.me>
Obtained from:	https://github.com/akrennmair/newsbeuter/issues/598
This commit is contained in:
Tilman Keskinoz 2017-09-16 19:12:25 +00:00
parent 5286b71104
commit e0f82c7741
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=449974
2 changed files with 27 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= newsbeuter
PORTVERSION= 2.9
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= www
MASTER_SITES= https://newsbeuter.org/downloads/ \
http://newsbeuter.org/downloads/

View File

@ -0,0 +1,26 @@
--- src/pb_controller.cpp
+++ src/pb_controller.cpp
@@ -306,9 +306,9 @@ void pb_controller::play_file(const std::string& file) {
if (player == "")
return;
cmdline.append(player);
- cmdline.append(" \"");
- cmdline.append(utils::replace_all(file,"\"", "\\\""));
- cmdline.append("\"");
+ cmdline.append(" \'");
+ cmdline.append(utils::replace_all(file,"'", "%27"));
+ cmdline.append("\'");
stfl::reset();
LOG(LOG_DEBUG, "pb_controller::play_file: running `%s'", cmdline.c_str());
::system(cmdline.c_str());
--- src/queueloader.cpp
+++ src/queueloader.cpp
@@ -130,7 +130,7 @@ std::string queueloader::get_filename(const std::string& str) {
strftime(lbuf, sizeof(lbuf), "%Y-%b-%d-%H%M%S.unknown", localtime(&t));
fn.append(lbuf);
} else {
- fn.append(base);
+ fn.append(utils::replace_all(base, "'", "%27"));
}
return fn;
}