Skip to content

Start path for server jar only after a colon - #201

Merged
pavog merged 3 commits into
masterfrom
server-jar-pattern-quadratic
Nov 13, 2026
Merged

pavog merged 3 commits into
masterfrom
server-jar-pattern-quadratic

Conversation

@pavog

@pavog pavog commented Nov 13, 2026

Copy link
Copy Markdown
Member

ServerJarInPluginFolderProblem could start the path at any non-space character and then searched up to the next colon or line end.
On a long line without a colon this is quadratic: 94 ms on 20 KB and 1.4 s on 80 KB, minutes for a long mod list.

Paper always writes the path after ": " ("Error loading plugin: plugins/server.jar appears to be ..." and in the exception message), so this PR starts it there with (?<=: ).
Relative paths, absolute paths, Windows paths and paths with spaces match as before; on 80 KB it now takes 0.1 ms.

Changes

  • start the path after ": " in ServerJarInPluginFolderProblem and add an example
  • remove it from KNOWN_UNSAFE_PATTERNS

@pavog
pavog merged commit 7ea80a6 into master Nov 13, 2026
3 checks passed
@pavog
pavog deleted the server-jar-pattern-quadratic branch November 13, 2026 21:23
@pavog
pavog restored the server-jar-pattern-quadratic branch November 13, 2026 21:25
@pavog
pavog deleted the server-jar-pattern-quadratic branch November 13, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant