diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index f3d84989d..47e0487d3 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -394,7 +394,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 9fc03ef64..982729cfb 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')); } /**