Skin also filters dropbox urls like /texture. (Thanks goodlyay)

This commit is contained in:
UnknownShadow200 2017-09-09 12:28:17 +10:00
parent 04b70d8297
commit 6263436d69
2 changed files with 4 additions and 2 deletions

View File

@ -69,6 +69,8 @@ namespace MCGalaxy.Commands.CPE {
if (skin.Length == 0) skin = defSkin; if (skin.Length == 0) skin = defSkin;
if (skin[0] == '+') if (skin[0] == '+')
skin = "http://skins.minecraft.net/MinecraftSkins/" + skin.Substring(1) + ".png"; skin = "http://skins.minecraft.net/MinecraftSkins/" + skin.Substring(1) + ".png";
CmdTexture.FilterURL(ref skin);
return skin; return skin;
} }

View File

@ -16,7 +16,7 @@
permissions and limitations under the Licenses. permissions and limitations under the Licenses.
*/ */
namespace MCGalaxy.Commands.World { namespace MCGalaxy.Commands.CPE {
public sealed class CmdTexture : Command { public sealed class CmdTexture : Command {
public override string name { get { return "Texture"; } } public override string name { get { return "Texture"; } }
public override string type { get { return CommandTypes.Other; } } 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 // 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")) { if (url.StartsWith("http://www.dropbox")) {
url = "http://dl.dropbox" + url.Substring("http://www.dropbox".Length); url = "http://dl.dropbox" + url.Substring("http://www.dropbox".Length);