Skip to content
Permalink
Browse files

convert forbidden character in filename(Windows) with underline

  • Loading branch information...
zoghal committed Aug 24, 2013
1 parent 59cef53 commit e157d8a7e66161c0db87e1440c8d8b5fb58ad381
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/Cake/Cache/Engine/FileEngine.php
  2. +8 −0 lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
@@ -388,7 +388,7 @@ public function key($key) {
return false;
}
$key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key)));
$key = Inflector::underscore(str_replace(array(DS, '/', '.','<','>','?',':','|','*','"'), '_', strval($key)));
return $key;
}
@@ -305,6 +305,14 @@ public function testKeyPath() {
$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'));
}
/**

0 comments on commit e157d8a

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.