Repository navigation
Conversation
… textures - StringUtils#legacyColor kept the case of '&#RRGGBB' hex digits, while names and lore read back from items are always serialized lowercase, so strict has item name/lore checks failed whenever a menu used uppercase hex. - SkullUtils#decodeSkinUrl threw IllegalArgumentException / JsonSyntaxException on texture values that are not valid base64 or not the expected JSON shape. Since texture- and basehead- has item checks decode every head in the inventory, a single malformed head from another plugin broke the requirement. Malformed values are now treated as having no skin url.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs in the
has itemrequirement. I found both while reviewing the Paper migration (#228).1. Uppercase hex colours never match
StringUtils#legacyColorkept the case of hex digits (&#AABBCC→§x§A§A§B§B§C§C). Names and lore read back from an item are always serialized in lowercase (§x§a§a§b§b§c§c). A strictname/lorecheck therefore failed whenever the menu used uppercase hex, even against the exact item DeluxeMenus had created from that config. The hex digits are now lowercased. This doesn't change the rendered colour.Comparing
legacyColor(configured)againstlegacy(colorItemText(configured)):&#aabbcc&lHello&#AABBCC&lHello&a&lHello2. Malformed head textures crash the check
SkullUtils#decodeSkinUrlthrewIllegalArgumentException(invalid base64) orJsonSyntaxException(not a JSON object).texture-andbasehead-has itemchecks decode every head they inspect, and nothing caught these errors. One head from another plugin with a non-standard texture value in a player's inventory was enough to make the requirement throw. Before the migration,texture-checks read the skin through the Bukkit profile API and didn't hit this. Malformed values are now treated as having no skin URL.I tested
getTextureIdFromBase64with: a valid texture (returns the id), invalid base64, non-object JSON ("hello",[1,2]), empty input, and wrong-typedtextures/SKIN/urlfields. Every malformed input now returnsnull; before, they threw.I also checked that the plugin still boots, loads its menus and reloads on Paper 26.2 build 112.