mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 19:28:55 +00:00
Use DIRECTORY_SEPERATOR constant for safer cross-platform file access
This commit is contained in:
parent
a860f16f4a
commit
ca0d682d87
@ -126,7 +126,7 @@ class PluginAPI extends stdClass{
|
||||
if($p === false){
|
||||
return false;
|
||||
}
|
||||
$path = DATA_PATH."plugins/".$p[1]["name"]."/";
|
||||
$path = join(DIRECTORY_SEPARATOR, array(DATA_PATH."plugins", $p[1]["name"], ""));
|
||||
$this->plugins[$p[1]["class"]][1]["path"] = $path;
|
||||
@mkdir($path);
|
||||
return $path;
|
||||
@ -170,12 +170,12 @@ class PluginAPI extends stdClass{
|
||||
}
|
||||
|
||||
public function loadAll(){
|
||||
$dir = dir(DATA_PATH."plugins/");
|
||||
$dir = dir(DATA_PATH."plugins" . DIRECTORY_SEPARATOR);
|
||||
while(false !== ($file = $dir->read())){
|
||||
if($file{0} !== "."){
|
||||
$ext = strtolower(substr($file, -3));
|
||||
if($ext === "php" or $ext === "pmf"){
|
||||
$this->load(DATA_PATH."plugins/" . $file);
|
||||
$this->load($dir . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user