fix chomens bot crsah exploit 2023 working

This commit is contained in:
Chayapak 2023-04-24 19:27:00 +07:00
parent c04ed184eb
commit f78b422a17
2 changed files with 19 additions and 13 deletions

View file

@ -4,9 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="improve returning output of commands"> <list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -98,13 +99,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680245437032</updated> <updated>1680245437032</updated>
</task> </task>
<task id="LOCAL-00067" summary="actually make creator configurable instead of hardcoding">
<created>1681619945065</created>
<option name="number" value="00067" />
<option name="presentableId" value="LOCAL-00067" />
<option name="project" value="LOCAL" />
<updated>1681619945065</updated>
</task>
<task id="LOCAL-00068" summary="improve trusted plugin"> <task id="LOCAL-00068" summary="improve trusted plugin">
<created>1681626702317</created> <created>1681626702317</created>
<option name="number" value="00068" /> <option name="number" value="00068" />
@ -441,7 +435,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1682324452741</updated> <updated>1682324452741</updated>
</task> </task>
<option name="localTasksCounter" value="116" /> <task id="LOCAL-00116" summary="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done">
<created>1682334617794</created>
<option name="number" value="00116" />
<option name="presentableId" value="LOCAL-00116" />
<option name="project" value="LOCAL" />
<updated>1682334617795</updated>
</task>
<option name="localTasksCounter" value="117" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -456,7 +457,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="f" />
<MESSAGE value="fard" /> <MESSAGE value="fard" />
<MESSAGE value="fard 2" /> <MESSAGE value="fard 2" />
<MESSAGE value="readme i guess" /> <MESSAGE value="readme i guess" />
@ -481,7 +481,8 @@
<MESSAGE value="fix extras chat" /> <MESSAGE value="fix extras chat" />
<MESSAGE value="actually improve the systemMessageReceived thing" /> <MESSAGE value="actually improve the systemMessageReceived thing" />
<MESSAGE value="improve returning output of commands" /> <MESSAGE value="improve returning output of commands" />
<option name="LAST_COMMIT_MESSAGE" value="improve returning output of commands" /> <MESSAGE value="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done" />
<option name="LAST_COMMIT_MESSAGE" value="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />

View file

@ -70,7 +70,12 @@ public class CommandHandlerPlugin {
public Component executeCommand (String input, CommandContext context, boolean inGame, boolean discord, boolean console, String hash, String ownerHash, MessageReceivedEvent event) { public Component executeCommand (String input, CommandContext context, boolean inGame, boolean discord, boolean console, String hash, String ownerHash, MessageReceivedEvent event) {
final String[] splitInput = input.split("\\s+"); final String[] splitInput = input.split("\\s+");
final String commandName = splitInput[0]; String commandName;
try {
commandName = splitInput[0];
} catch (ArrayIndexOutOfBoundsException e) {
return Component.text("Empty command").color(NamedTextColor.RED);
}
final Command command = ElementUtilities.findCommand(commands, commandName); final Command command = ElementUtilities.findCommand(commands, commandName);