From e157d8a7e66161c0db87e1440c8d8b5fb58ad381 Mon Sep 17 00:00:00 2001 From: Saleh Souzanchi Date: Sun, 25 Aug 2013 02:09:13 +0430 Subject: [PATCH 1/2] convert forbidden character in filename(Windows) with underline --- lib/Cake/Cache/Engine/FileEngine.php | 2 +- lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 35cc95698..2eb02ffc2 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -388,7 +388,7 @@ class FileEngine extends CacheEngine { return false; } - $key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key))); + $key = Inflector::underscore(str_replace(array(DS, '/', '.','<','>','?',':','|','*','"'), '_', strval($key))); return $key; } diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index f1854fa5c..4c3c4b569 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -305,6 +305,14 @@ class FileEngineTest extends CakeTestCase { $result = Cache::clear(false, 'file_test'); $this->assertTrue($result); + + $result = Cache::write('domain.test.com:8080', 'here', 'file_test'); + $this->assertTrue($result); + $this->assertTrue(file_exists(CACHE . 'cake_domain_test_com_8080')); + + $result = Cache::write('command>dir|more', 'here', 'file_test'); + $this->assertTrue($result); + $this->assertTrue(file_exists(CACHE . 'cake_command_dir_more')); } /** From d606bcb7fd0afc69e35eea301573a0d530e7b211 Mon Sep 17 00:00:00 2001 From: Saleh Souzanchi Date: Sun, 25 Aug 2013 02:24:37 +0430 Subject: [PATCH 2/2] convert forbidden character in filename(Windows) with underline --- lib/Cake/Cache/Engine/FileEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 2eb02ffc2..4f88ca3b6 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -388,7 +388,7 @@ class FileEngine extends CacheEngine { return false; } - $key = Inflector::underscore(str_replace(array(DS, '/', '.','<','>','?',':','|','*','"'), '_', strval($key))); + $key = Inflector::underscore(str_replace(array(DS, '/', '.', '<', '>', '?', ':', '|', '*', '"'), '_', strval($key))); return $key; }