From e5d8df0c7e55a76380e68220e6c756c29c370e94 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 28 Jan 2013 14:38:56 +0100 Subject: [PATCH] BUG Allow Windows paths in FileWriteableCheck --- code/checks/FileWriteableCheck.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/checks/FileWriteableCheck.php b/code/checks/FileWriteableCheck.php index 366db02..f78a0f5 100644 --- a/code/checks/FileWriteableCheck.php +++ b/code/checks/FileWriteableCheck.php @@ -12,7 +12,8 @@ class FileWriteableCheck implements EnvironmentCheck { } function check() { - if($this->path[0] == '/') $filename = $this->path; + // Check for absolute paths (either by leading slash, or by directory existence for Win compat) + if($this->path[0] == '/' || file_exists($this->path)) $filename = $this->path; else $filename = BASE_PATH . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $this->path); if(file_exists($filename)) $isWriteable = is_writeable($filename);