From 554026bfbe087c7b931245ee3046159fca5ab591 Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Fri, 25 Apr 2014 09:42:54 -0700 Subject: [PATCH] cleaning up some potential bugs --- .../com/rarchives/ripme/ripper/rippers/ImagefapRipper.java | 5 +---- src/main/java/com/rarchives/ripme/utils/Utils.java | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java index a37a0017..3f781da9 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java @@ -104,10 +104,7 @@ public class ImagefapRipper extends AlbumRipper { } public boolean canRip(URL url) { - if (!url.getHost().endsWith(DOMAIN)) { - return false; - } - return true; + return url.getHost().endsWith(DOMAIN); } } \ No newline at end of file diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 3c514846..9f4f2b1e 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -245,9 +245,13 @@ public class Utils { } public static String filesystemSafe(String text) { - return text.replaceAll("[^a-zA-Z0-9.-]", "_") + text = text.replaceAll("[^a-zA-Z0-9.-]", "_") .replaceAll("__", "_") .replaceAll("_+$", ""); + if (text.length() > 255) { + text = text.substring(0, 254); + } + return text; } public static String bytesToHumanReadable(int bytes) {