diff --git a/src/Analysis/Problem/Paper/ServerJarInPluginFolderProblem.php b/src/Analysis/Problem/Paper/ServerJarInPluginFolderProblem.php index 2da448a..88e06fc 100644 --- a/src/Analysis/Problem/Paper/ServerJarInPluginFolderProblem.php +++ b/src/Analysis/Problem/Paper/ServerJarInPluginFolderProblem.php @@ -26,13 +26,16 @@ public function getMessage(): string } /** + * Example: "Error loading plugin: plugins/server.jar appears to be a server jar! Server jars do not belong in the plugin folder." + * * @inheritDoc */ public static function getPatterns(): array { return [ // the path is either relative (plugins/server.jar) or absolute (/srv/plugins/server.jar, C:\server\plugins\server.jar) - '/((?:[a-zA-Z]:)?[^\s:][^\n:]*?\.jar) appears to be a server jar! Server jars do not belong in the plugin folder\./' + // it always follows ": ", starting it anywhere else makes the pattern scan the rest of the line from every position + '/(?<=: )((?:[a-zA-Z]:)?[^\s:][^\n:]*?\.jar) appears to be a server jar! Server jars do not belong in the plugin folder\./' ]; } diff --git a/test/tests/Performance/PatternSafetyTest.php b/test/tests/Performance/PatternSafetyTest.php index a60234e..6bde897 100644 --- a/test/tests/Performance/PatternSafetyTest.php +++ b/test/tests/Performance/PatternSafetyTest.php @@ -5,7 +5,6 @@ use Aternos\Codex\Analysis\PatternInsightInterface; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\ChunkLoadExceptionProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModDependencyProblem; -use Aternos\Codex\Minecraft\Analysis\Problem\Paper\ServerJarInPluginFolderProblem; use Aternos\Codex\Minecraft\Test\Logs\TestLog; use FilesystemIterator; use Generator; @@ -76,7 +75,6 @@ class PatternSafetyTest extends TestCase protected const array KNOWN_UNSAFE_PATTERNS = [ ChunkLoadExceptionProblem::class => [0, 1, 2], ModDependencyProblem::class => ["loading-failed-exception"], - ServerJarInPluginFolderProblem::class => [0], ]; /**