From 572208e5970b5f945f18215e006ed71abd620e58 Mon Sep 17 00:00:00 2001 From: Wealth <30428646+Wea1thRS@users.noreply.github.com> Date: Sat, 4 Jan 2020 12:26:39 -0600 Subject: [PATCH] Reddit Ripper Fix! Revert "Reddit hangs fix" This reverts commit 502d5530376319297cc99763d52f5bbcd2b337e9. real fix. --- src/main/java/com/rarchives/ripme/utils/Utils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index a009c7a1e..315e4dd30 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -482,12 +482,12 @@ public static String shortenPath(File file) { * @return The sanitized text. */ public static String filesystemSanitized(String text) { - text = text.replaceAll("[^a-zA-Z0-9.-]", "_"); + text = text.replaceAll("[^ !#-)+-.0-9;=@-\\[\\]-{}~]", "").trim().replaceAll("\\.+$", ""); return text; } public static String filesystemSafe(String text) { - text = text.replaceAll("[^a-zA-Z0-9.-]", "_").replaceAll("__", "_").replaceAll("_+$", ""); + text = text.replaceAll("[^ !#-)+-.0-9;=@-\\[\\]-{}~]", "").trim().replaceAll("\\.+$", ""); if (text.length() > 100) { text = text.substring(0, 99); } @@ -857,7 +857,7 @@ public static boolean fuzzyExists(File folder, String fileName) { } public static String sanitizeSaveAs(String fileNameToSan) { - return fileNameToSan.replaceAll("[\\\\/:*?\"<>|]", "_"); + return fileNameToSan.replaceAll("[^ !#-)+-.0-9;=@-\\[\\]-{}~]", "").trim().replaceAll("\\.+$", ""); } public static File shortenSaveAsWindows(String ripsDirPath, String fileName) throws FileNotFoundException {