mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Merge pull request #881 from JWhy/patch-1
Use DIRECTORY_SEPERATOR constant for safer cross-platform file access
This commit is contained in:
commit
c197a58a3a
1 changed files with 3 additions and 3 deletions
|
|
@ -126,7 +126,7 @@ class PluginAPI extends stdClass{
|
||||||
if($p === false){
|
if($p === false){
|
||||||
return 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;
|
$this->plugins[$p[1]["class"]][1]["path"] = $path;
|
||||||
@mkdir($path);
|
@mkdir($path);
|
||||||
return $path;
|
return $path;
|
||||||
|
|
@ -170,12 +170,12 @@ class PluginAPI extends stdClass{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadAll(){
|
public function loadAll(){
|
||||||
$dir = dir(DATA_PATH."plugins/");
|
$dir = dir(DATA_PATH."plugins" . DIRECTORY_SEPARATOR);
|
||||||
while(false !== ($file = $dir->read())){
|
while(false !== ($file = $dir->read())){
|
||||||
if($file{0} !== "."){
|
if($file{0} !== "."){
|
||||||
$ext = strtolower(substr($file, -3));
|
$ext = strtolower(substr($file, -3));
|
||||||
if($ext === "php" or $ext === "pmf"){
|
if($ext === "php" or $ext === "pmf"){
|
||||||
$this->load(DATA_PATH."plugins/" . $file);
|
$this->load($dir . $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue