Fix: Extract plugin name from error message with dot in plugin name #103
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.
Problem
If a plugin has a dot in its name, the part after the
.
in the name is cut off. This is because this part is interpreted as a file extension and is not returned byIn the function
extractPluginName(string $pluginPath): string
we have to expeect that$pluginPath
can be a path, a file name or a plugin name. Therefore, we must not simply cut it off after the.
. Otherwise, for example, mclo.gs becomes just mclo, see this example: https://mclo.gs/4UEgJ73Solution
We always extract the complete file name using
$pluginPath
is a path, the file name (and extension) is extracted.$pluginPath
is the file name (and extension), nothing happens.$pluginPath
is only the plugin name, nothing happens.We then check whether the result ends with
.jar
. We can assume that it does, because plugins must always be a.jar
file. Other files are not loaded from the server.