mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Stricter regex syntax for PHP7.3 support.
This commit is contained in:
parent
46d8aad91a
commit
d6117630bd
@ -12,7 +12,7 @@ function getTempFolder($base = null) {
|
|||||||
$parent = getTempParentFolder($base);
|
$parent = getTempParentFolder($base);
|
||||||
|
|
||||||
// The actual temp folder is a subfolder of getTempParentFolder(), named by username and suffixed with currently used php-version
|
// 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;
|
$subfolder = $parent . DIRECTORY_SEPARATOR . getTempFolderUsername() . $phpversion;
|
||||||
|
|
||||||
if(!@file_exists($subfolder)) {
|
if(!@file_exists($subfolder)) {
|
||||||
|
@ -17,7 +17,7 @@ class CoreTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetTempPathInProject() {
|
public function testGetTempPathInProject() {
|
||||||
$user = getTempFolderUsername();
|
$user = getTempFolderUsername();
|
||||||
$phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION);
|
$phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION);
|
||||||
if(file_exists($this->tempPath)) {
|
if(file_exists($this->tempPath)) {
|
||||||
$this->assertEquals(getTempFolder(BASE_PATH), $this->tempPath . DIRECTORY_SEPARATOR . $user . $phpversion);
|
$this->assertEquals(getTempFolder(BASE_PATH), $this->tempPath . DIRECTORY_SEPARATOR . $user . $phpversion);
|
||||||
} else {
|
} else {
|
||||||
@ -43,7 +43,7 @@ class CoreTest extends SapphireTest {
|
|||||||
public function tearDown() {
|
public function tearDown() {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
$user = getTempFolderUsername();
|
$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;
|
$base = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'silverstripe-cache' . $phpversion;
|
||||||
|
|
||||||
foreach(array(
|
foreach(array(
|
||||||
|
Loading…
Reference in New Issue
Block a user