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

Commit c8fea2f

Browse files
committed
Work around shell code in podcast names (#598)
1 parent 1bc93b8 commit c8fea2f

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
@@ -367,9 +367,9 @@ void pb_controller::play_file(const std::string& file) {
367367
if (player == "")
368368
return;
369369
cmdline.append(player);
370-
cmdline.append(" \"");
371-
cmdline.append(utils::replace_all(file,"\"", "\\\""));
372-
cmdline.append("\"");
370+
cmdline.append(" '");
371+
cmdline.append(utils::replace_all(file,"'", "%27"));
372+
cmdline.append("'");
373373
stfl::reset();
374374
utils::run_interactively(cmdline, "pb_controller::play_file");
375375
}

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)