From a5010201989ef98f0173a4e36bd097b90b5b1b03 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 2 Jan 2013 17:33:24 +0100 Subject: [PATCH] Fix for .DS_Store folders in Mac --- src/API/PluginAPI.php | 2 +- src/API/ServerAPI.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index e9e600e2..e594e1bd 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -157,7 +157,7 @@ class PluginAPI extends stdClass{ console("[INFO] Loading Plugins..."); $dir = dir(FILE_PATH."plugins/"); while(false !== ($file = $dir->read())){ - if($file !== "." and $file !== ".."){ + if($file{0} !== "."){ if(strtolower(substr($file, -3)) === "php"){ $this->load(FILE_PATH."plugins/" . $file); } diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index d74e1224..da5f8a06 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -169,7 +169,7 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run console("[INFO] Loading default APIs"); $dir = dir(FILE_PATH."src/API/"); while(false !== ($file = $dir->read())){ - if($file !== "." and $file !== ".."){ + if($file{0} !== "."){ //Hidden and upwards folders $API = basename($file, ".php"); if(strtolower($API) !== "serverapi"){ $name = strtolower(substr($API, 0, -3));