Skip to content

Commit

Permalink
Merge pull request TeamNewPipe#10489 from sqproman/missing_quotation_…
Browse files Browse the repository at this point in the history
…replace_char_crash

Quote filename replacement characters to fix crashes when downloading streams with special characters
  • Loading branch information
Stypox authored Nov 16, 2023
2 parents be4a5a5 + 6d0bb02 commit 545f9ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/org/schabi/newpipe/util/FilenameUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.schabi.newpipe.R;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class FilenameUtils {
Expand Down Expand Up @@ -51,7 +52,7 @@ public static String createFilename(final Context context, final String title) {

final Pattern pattern = Pattern.compile(charset);

return createFilename(title, pattern, replacementChar);
return createFilename(title, pattern, Matcher.quoteReplacement(replacementChar));
}

/**
Expand Down

0 comments on commit 545f9ae

Please sign in to comment.