Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design

# Conflicts:
#	application/datamodel.application.xml
#	application/itopwebpage.class.inc.php
#	css/light-grey.scss
This commit is contained in:
Molkobain
2020-08-19 10:20:37 +02:00
80 changed files with 2483 additions and 1530 deletions

View File

@@ -68,7 +68,7 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
*/
public function testRealPath($sPath, $sBasePath, $expected)
{
$this->assertSame($expected, utils::RealPath($sPath, $sBasePath));
$this->assertSame($expected, utils::RealPath($sPath, $sBasePath), "utils::RealPath($sPath, $sBasePath) does not match $expected");
}
public function realPathDataProvider()
@@ -77,14 +77,19 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
$sSep = DIRECTORY_SEPARATOR;
$sItopRootRealPath = realpath(APPROOT).$sSep;
$sLicenseFileName = 'license.txt';
if (!is_file(APPROOT.$sLicenseFileName))
{
$sLicenseFileName = 'LICENSE';
}
return [
'licence.txt' => [APPROOT.'license.txt', APPROOT, $sItopRootRealPath.'license.txt'],
$sLicenseFileName => [APPROOT.$sLicenseFileName, APPROOT, $sItopRootRealPath.$sLicenseFileName],
'unexisting file' => [APPROOT.'license_DOES_NOT_EXIST.txt', APPROOT, false],
'/license.txt' => [APPROOT.$sSep.'license.txt', APPROOT, $sItopRootRealPath.'license.txt'],
'%2flicense.txt' => [APPROOT.'%2flicense.txt', APPROOT, false],
'../license.txt' => [APPROOT.'..'.$sSep.'license.txt', APPROOT, false],
'%2e%2e%2flicense.txt' => [APPROOT.'%2e%2e%2flicense.txt', APPROOT, false],
'/'.$sLicenseFileName => [APPROOT.$sSep.$sLicenseFileName, APPROOT, $sItopRootRealPath.$sLicenseFileName],
'%2f'.$sLicenseFileName => [APPROOT.'%2f'. $sLicenseFileName, APPROOT, false],
'../'.$sLicenseFileName => [APPROOT.'..'.$sSep.$sLicenseFileName, APPROOT, false],
'%2e%2e%2f'.$sLicenseFileName => [APPROOT.'%2e%2e%2f'.$sLicenseFileName, APPROOT, false],
'application/utils.inc.php with basepath=APPROOT' => [
APPROOT.'application/utils.inc.php',
APPROOT,