Skip to content

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

Open
pavog wants to merge 1 commit into
masterfrom
server-jar-pattern-quadratic
Open

pavog wants to merge 1 commit 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

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