Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Work around shell code in podcast names (#598)
Browse files Browse the repository at this point in the history
Minoru committed Sep 16, 2017

Verified

This commit was signed with the committer’s verified signature.
Minoru Alexander Batischev
1 parent 969fcb1 commit 26f5a43
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/pb_controller.cpp
Original file line number Diff line number Diff line change
@@ -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());
2 changes: 1 addition & 1 deletion src/queueloader.cpp
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 26f5a43

Please sign in to comment.