From 6263436d695ebdb8c57e4e351b55d51248d59fb8 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 9 Sep 2017 12:28:17 +1000 Subject: [PATCH] Skin also filters dropbox urls like /texture. (Thanks goodlyay) --- MCGalaxy/Commands/CPE/CmdSkin.cs | 2 ++ MCGalaxy/Commands/CPE/CmdTexture.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MCGalaxy/Commands/CPE/CmdSkin.cs b/MCGalaxy/Commands/CPE/CmdSkin.cs index 48a25d391..a9b9cd138 100644 --- a/MCGalaxy/Commands/CPE/CmdSkin.cs +++ b/MCGalaxy/Commands/CPE/CmdSkin.cs @@ -69,6 +69,8 @@ namespace MCGalaxy.Commands.CPE { if (skin.Length == 0) skin = defSkin; if (skin[0] == '+') skin = "http://skins.minecraft.net/MinecraftSkins/" + skin.Substring(1) + ".png"; + + CmdTexture.FilterURL(ref skin); return skin; } diff --git a/MCGalaxy/Commands/CPE/CmdTexture.cs b/MCGalaxy/Commands/CPE/CmdTexture.cs index 40c55f1dc..38a5d028e 100644 --- a/MCGalaxy/Commands/CPE/CmdTexture.cs +++ b/MCGalaxy/Commands/CPE/CmdTexture.cs @@ -16,7 +16,7 @@ permissions and limitations under the Licenses. */ -namespace MCGalaxy.Commands.World { +namespace MCGalaxy.Commands.CPE { public sealed class CmdTexture : Command { public override string name { get { return "Texture"; } } public override string type { get { return CommandTypes.Other; } } @@ -84,7 +84,7 @@ namespace MCGalaxy.Commands.World { } } - static void FilterURL(ref string url) { + internal static void FilterURL(ref string url) { // a lot of people try linking to the dropbox page instead of directly to file, so we auto correct them if (url.StartsWith("http://www.dropbox")) { url = "http://dl.dropbox" + url.Substring("http://www.dropbox".Length);