Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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\./'
];
}

Expand Down
2 changes: 0 additions & 2 deletions test/tests/Performance/PatternSafetyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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],
];

/**
Expand Down
Loading