From 2b0ab1a084534179ff25810963c83f5be286747f Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Tue, 11 May 2021 20:16:54 +0200 Subject: [PATCH] Fixes #1046 Also remove option to shorten urls for schematic upload. This option does not work with self hosted interfaces, nor is it really safe to use, as per-design. --- .../main/java/com/boydti/fawe/config/Settings.java | 7 +------ .../com/boydti/fawe/util/EditSessionBuilder.java | 12 ++++-------- .../sk89q/worldedit/command/ClipboardCommands.java | 9 --------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java index 2dec019a5..c9beed2bd 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java @@ -409,11 +409,6 @@ public class Settings extends Config { } public static class WEB { - @Comment({ - "Should download urls be shortened?", - " - Links are less secure as they could be brute forced" - }) - public boolean SHORTEN_URLS = false; @Comment({ "The web interface for clipboards", " - All schematics are anonymous and private", @@ -430,7 +425,7 @@ public class Settings extends Config { }) public List ALLOWED_PLUGINS = new ArrayList<>(); @Comment("Should debug messages be sent when third party extents are used?") - public boolean DEBUG = false; + public boolean DEBUG = true; } @Comment("Generic tick limiter (not necessarily WorldEdit related, but useful to stop abuse)") diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java index f2062d50c..ca72fac43 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java @@ -243,16 +243,12 @@ public class EditSessionBuilder { if (Settings.IMP.EXTENT.DEBUG) { if (event.getActor() != null) { event.getActor().printDebug(TextComponent.of("Potentially unsafe extent blocked: " + toReturn.getClass().getName())); - event.getActor().printDebug(TextComponent.of(" - For area restrictions, it is recommended to use the FaweAPI")); - event.getActor().printDebug(TextComponent.of(" - For block logging, it is recommended to use BlocksHub")); - event.getActor().printDebug(TextComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list")); - event.getActor().printDebug(TextComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml")); + event.getActor().printDebug(TextComponent.of(" - For area restrictions and block logging, it is recommended to use the FaweAPI")); + event.getActor().printDebug(TextComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list in config.yml")); } else { LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName()); - LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI"); - LOGGER.debug(" - For block logging, it is recommended to use BlocksHub"); - LOGGER.debug(" - To allow this plugin add it to the FAWE `allowed-plugins` list"); - LOGGER.debug(" - To hide this message set `debug` to false in the FAWE config.yml"); + LOGGER.debug(" - For area restrictions and block logging, it is recommended to use the FaweAPI"); + LOGGER.debug(" - To allow this plugin, add it to the FAWE `allowed-plugins` list in config.yml"); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 8743e1e1d..29d2f6f11 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -90,7 +90,6 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URI; import java.net.URL; -import java.net.URLEncoder; import java.nio.file.Files; import java.util.HashSet; import java.util.List; @@ -101,7 +100,6 @@ import java.util.zip.ZipOutputStream; import static com.sk89q.worldedit.command.util.Logging.LogMode.PLACEMENT; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; - /** * Clipboard commands. */ @@ -386,13 +384,6 @@ public class ClipboardCommands { player.print(Caption.of("fawe.web.generating.link.failed")); } else { String urlText = url.toString(); - if (Settings.IMP.WEB.SHORTEN_URLS) { - try { - urlText = MainUtil.getText("https://athion.net/s/?" + URLEncoder.encode(url.toString(), "UTF-8")); - } catch (IOException e) { - e.printStackTrace(); - } - } player.print(Caption.of("fawe.web.download.link", urlText).clickEvent(ClickEvent.openUrl(urlText))); } }