mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Fixes #1570. Removed isValidPharFilename check as the function is very unreliable.
This commit is contained in:
parent
65523972c2
commit
88bcaea292
@ -51,7 +51,7 @@ class PharPluginLoader implements PluginLoader{
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function loadPlugin($file){
|
||||
if(\Phar::isValidPharFilename($file) and ($description = $this->getPluginDescription($file)) instanceof PluginDescription){
|
||||
if(($description = $this->getPluginDescription($file)) instanceof PluginDescription){
|
||||
MainLogger::getLogger()->info("Loading " . $description->getFullName());
|
||||
$dataFolder = dirname($file) . DIRECTORY_SEPARATOR . $description->getName();
|
||||
if(file_exists($dataFolder) and !is_dir($dataFolder)){
|
||||
@ -84,15 +84,13 @@ class PharPluginLoader implements PluginLoader{
|
||||
* @return PluginDescription
|
||||
*/
|
||||
public function getPluginDescription($file){
|
||||
if(\Phar::isValidPharFilename($file)){
|
||||
$phar = new \Phar($file);
|
||||
if(isset($phar["plugin.yml"])){
|
||||
$pluginYml = $phar["plugin.yml"];
|
||||
if($pluginYml instanceof \PharFileInfo){
|
||||
return new PluginDescription($pluginYml->getContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
$phar = new \Phar($file);
|
||||
if(isset($phar["plugin.yml"])){
|
||||
$pluginYml = $phar["plugin.yml"];
|
||||
if($pluginYml instanceof \PharFileInfo){
|
||||
return new PluginDescription($pluginYml->getContent());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user