mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Squashed commit of the following:
commitcc48f93556
Merge:71127c31
dd373fc9
Author: Paul Reilly <pawereus@gmail.com> Date: Fri Mar 31 21:15:34 2023 -0500 Merge branch 'main' into development commitdd373fc9aa
Merge:edb3dbfd
41331e71
Author: Paldiu <pawereus@gmail.com> Date: Fri Mar 31 18:25:42 2023 -0500 Merge pull request #307 from AtlasMediaGroup/RELEASE-2022.06.1 Release 2022.06.1 commit41331e719d
Author: Video <videogamesm12@gmail.com> Date: Wed Mar 8 19:58:14 2023 -0700 Updates version to 2022.06.1 commit72c83ba84a
Merge:edb3dbfd
3deaaafb
Author: Video <videogamesm12@gmail.com> Date: Wed Mar 8 19:53:51 2023 -0700 Merge pull request #306 from AtlasMediaGroup/critical-exploit-fix Patches critical exploit in the command blocker commit3deaaafb88
Author: Video <videogamesm12@gmail.com> Date: Wed Mar 8 19:52:30 2023 -0700 Patches critical exploit
This commit is contained in:
parent
f53ba1bd76
commit
dbb289db66
@ -24,7 +24,7 @@ import org.bukkit.plugin.SimplePluginManager;
|
|||||||
|
|
||||||
public class CommandBlocker extends FreedomService
|
public class CommandBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
private final Pattern whitespacePattern = Pattern.compile("^/?( +)(.*)?");
|
||||||
private final Pattern flagPattern = Pattern.compile("(:([0-9]){5,})");
|
private final Pattern flagPattern = Pattern.compile("(:([0-9]){5,})");
|
||||||
//
|
//
|
||||||
private final Map<String, CommandBlockerEntry> entryList = Maps.newHashMap();
|
private final Map<String, CommandBlockerEntry> entryList = Maps.newHashMap();
|
||||||
@ -157,6 +157,14 @@ public class CommandBlocker extends FreedomService
|
|||||||
|
|
||||||
// Format
|
// Format
|
||||||
command = command.toLowerCase().trim();
|
command = command.toLowerCase().trim();
|
||||||
|
|
||||||
|
// Whitespaces
|
||||||
|
Matcher whitespaceMatcher = whitespacePattern.matcher(command);
|
||||||
|
if (whitespaceMatcher.matches() && whitespaceMatcher.groupCount() == 2)
|
||||||
|
{
|
||||||
|
command = whitespaceMatcher.group(2);
|
||||||
|
}
|
||||||
|
|
||||||
command = command.startsWith("/") ? command.substring(1) : command;
|
command = command.startsWith("/") ? command.substring(1) : command;
|
||||||
|
|
||||||
// Check for plugin specific commands
|
// Check for plugin specific commands
|
||||||
|
1
pom.xml
1
pom.xml
@ -13,6 +13,7 @@
|
|||||||
<module>discord</module>
|
<module>discord</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<tfm.build.codename>Caladrius</tfm.build.codename>
|
<tfm.build.codename>Caladrius</tfm.build.codename>
|
||||||
|
Loading…
Reference in New Issue
Block a user