From 3119c6e8935f468fe226cb8427d00f322e9693f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Martins?= Date: Wed, 28 Nov 2012 23:19:52 +0000 Subject: [PATCH 1/2] for working in windows PHP 5.3.13, apache 2.2.22 Not tested in linux --- code/controllers/XHR.php | 1 + code/dataobjects/DisplayAnythingGallery.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/controllers/XHR.php b/code/controllers/XHR.php index 04c566b..c31e405 100644 --- a/code/controllers/XHR.php +++ b/code/controllers/XHR.php @@ -26,6 +26,7 @@ public function saveToTmp() { $this->tmp_handle = fopen($this->tmp_location, "w"); stream_copy_to_stream($input, $this->tmp_handle); fclose($input); + fclose($this->tmp_handle); return true; } diff --git a/code/dataobjects/DisplayAnythingGallery.php b/code/dataobjects/DisplayAnythingGallery.php index 0708bf6..94419e9 100644 --- a/code/dataobjects/DisplayAnythingGallery.php +++ b/code/dataobjects/DisplayAnythingGallery.php @@ -595,7 +595,7 @@ final public function Upload() { //final location of file $targetDirectory = "/" . trim($this->target_location, "/ "); - $uploadPath = "/" . trim(ASSETS_PATH, "/ ") . $targetDirectory; + $uploadPath = trim(ASSETS_PATH, "/ ") . $targetDirectory; $uploadDirectory = ASSETS_DIR . $targetDirectory; if(!is_writable(ASSETS_PATH)) { From 40909a0e49b990c590e1ce2d94285259cea822f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Martins?= Date: Sat, 29 Dec 2012 13:14:48 +0000 Subject: [PATCH 2/2] This work form windows and for linux. I do not know in this case what is the purpose of trim, but it was remove the left \ --- code/dataobjects/DisplayAnythingGallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/dataobjects/DisplayAnythingGallery.php b/code/dataobjects/DisplayAnythingGallery.php index 94419e9..4b9b712 100644 --- a/code/dataobjects/DisplayAnythingGallery.php +++ b/code/dataobjects/DisplayAnythingGallery.php @@ -595,7 +595,7 @@ final public function Upload() { //final location of file $targetDirectory = "/" . trim($this->target_location, "/ "); - $uploadPath = trim(ASSETS_PATH, "/ ") . $targetDirectory; + $uploadPath = rtrim(ASSETS_PATH, "/ ") . $targetDirectory; $uploadDirectory = ASSETS_DIR . $targetDirectory; if(!is_writable(ASSETS_PATH)) {