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

Commit 26f5a43

Browse files
committed
Work around shell code in podcast names (#598)
1 parent 969fcb1 commit 26f5a43

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/pb_controller.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ void pb_controller::play_file(const std::string& file) {
306306
if (player == "")
307307
return;
308308
cmdline.append(player);
309-
cmdline.append(" \"");
310-
cmdline.append(utils::replace_all(file,"\"", "\\\""));
311-
cmdline.append("\"");
309+
cmdline.append(" \'");
310+
cmdline.append(utils::replace_all(file,"'", "%27"));
311+
cmdline.append("\'");
312312
stfl::reset();
313313
LOG(LOG_DEBUG, "pb_controller::play_file: running `%s'", cmdline.c_str());
314314
::system(cmdline.c_str());

Diff for: src/queueloader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ std::string queueloader::get_filename(const std::string& str) {
130130
strftime(lbuf, sizeof(lbuf), "%Y-%b-%d-%H%M%S.unknown", localtime(&t));
131131
fn.append(lbuf);
132132
} else {
133-
fn.append(base);
133+
fn.append(utils::replace_all(base, "'", "%27"));
134134
}
135135
return fn;
136136
}

0 commit comments

Comments
 (0)