diff --git a/core/TempPath.php b/core/TempPath.php index 4f3a94c85..0bc6645e5 100644 --- a/core/TempPath.php +++ b/core/TempPath.php @@ -12,7 +12,7 @@ function getTempFolder($base = null) { $parent = getTempParentFolder($base); // The actual temp folder is a subfolder of getTempParentFolder(), named by username and suffixed with currently used php-version - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); $subfolder = $parent . DIRECTORY_SEPARATOR . getTempFolderUsername() . $phpversion; if(!@file_exists($subfolder)) { diff --git a/tests/core/CoreTest.php b/tests/core/CoreTest.php index 5b4cc7510..06c716255 100644 --- a/tests/core/CoreTest.php +++ b/tests/core/CoreTest.php @@ -17,7 +17,7 @@ class CoreTest extends SapphireTest { public function testGetTempPathInProject() { $user = getTempFolderUsername(); - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); if(file_exists($this->tempPath)) { $this->assertEquals(getTempFolder(BASE_PATH), $this->tempPath . DIRECTORY_SEPARATOR . $user . $phpversion); } else { @@ -43,9 +43,9 @@ class CoreTest extends SapphireTest { public function tearDown() { parent::tearDown(); $user = getTempFolderUsername(); - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); $base = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'silverstripe-cache' . $phpversion; - + foreach(array( 'C--inetpub-wwwroot-silverstripe-test-project', '-Users-joebloggs-Sites-silverstripe-test-project',