From ca0d682d87d7c8d6384672d905ed7dcc91ce2206 Mon Sep 17 00:00:00 2001 From: JWhy Date: Mon, 21 Oct 2013 12:27:48 +0200 Subject: [PATCH] Use DIRECTORY_SEPERATOR constant for safer cross-platform file access --- src/API/PluginAPI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index b9bdb069d..dafac38d6 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -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); } } }