Merge #15742 - remove double slash on TempDir
Pull-request: #15742 Closes: #15742 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
4450bcec55
@ -1673,7 +1673,7 @@ class Config
|
||||
if (empty($path)) {
|
||||
$path = null;
|
||||
} else {
|
||||
$path .= '/' . $name;
|
||||
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name;
|
||||
if (! @is_dir($path)) {
|
||||
@mkdir($path, 0770, true);
|
||||
}
|
||||
|
||||
@ -1007,6 +1007,39 @@ class ConfigTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for getTempDir
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @group file-system
|
||||
*/
|
||||
public function testGetTempDir(): void
|
||||
{
|
||||
$this->object->set('TempDir', sys_get_temp_dir() . DIRECTORY_SEPARATOR);
|
||||
// Check no double slash is here
|
||||
$this->assertEquals(
|
||||
sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'upload',
|
||||
$this->object->getTempDir('upload')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for getUploadTempDir
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @group file-system
|
||||
*/
|
||||
public function testGetUploadTempDir(): void
|
||||
{
|
||||
$this->object->set('TempDir', sys_get_temp_dir() . DIRECTORY_SEPARATOR);
|
||||
$this->assertEquals(
|
||||
$this->object->getTempDir('upload'),
|
||||
$this->object->getUploadTempDir()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for isGitRevision
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user