From 0d7d650450d782f5288efb4408a1594b3ec9db2f Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 8 Aug 2012 09:51:53 -0300 Subject: [PATCH 1/2] Fix temp files with spaces. --- api/fedora_item.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 0c00e175..40edee64 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1118,7 +1118,9 @@ RDF; $created_temp = TRUE; } - $file_url = file_create_url($file); + $parts = explode('/', $file); + $parts = array_map('rawurlencode', $parts); + $file_url = file_create_url(implode('/', $parts)); $toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); From c69af4854e1ee6da9ed639927dc4ae36506e963a Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 8 Aug 2012 11:18:17 -0300 Subject: [PATCH 2/2] Make fix slightly more portable. --- api/fedora_item.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 40edee64..03de0605 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1118,9 +1118,9 @@ RDF; $created_temp = TRUE; } - $parts = explode('/', $file); + $parts = explode(DIRECTORY_SEPARATOR, $file); $parts = array_map('rawurlencode', $parts); - $file_url = file_create_url(implode('/', $parts)); + $file_url = file_create_url(implode(DIRECTORY_SEPARATOR, $parts)); $toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage);