diff --git a/src/pocketmine/plugin/PluginDescription.php b/src/pocketmine/plugin/PluginDescription.php index 4cf9b99fb..69ca61c7f 100644 --- a/src/pocketmine/plugin/PluginDescription.php +++ b/src/pocketmine/plugin/PluginDescription.php @@ -66,8 +66,8 @@ class PluginDescription{ * @throws PluginException */ private function loadMap(array $plugin){ - $this->name = preg_replace("[^A-Za-z0-9 _.-]", "", $plugin["name"]); - if($this->name === ""){ + $this->name = $plugin["name"]; + if(preg_match('/^[A-Za-z0-9 _.-]+$/', $this->name) === 0){ throw new PluginException("Invalid PluginDescription name"); } $this->name = str_replace(" ", "_", $this->name);