Merge remote-tracking branch 'origin/develop' into feature/4517-from-dev

# Conflicts:
#	CONTRIBUTING.md
#	composer.lock
#	core/designdocument.class.inc.php
#	lib/composer/installed.json
#	lib/composer/installed.php
This commit is contained in:
Molkobain
2022-07-28 10:30:25 +02:00
246 changed files with 19028 additions and 20326 deletions

View File

@@ -1942,21 +1942,20 @@ class utils
*/
public static function CompileCSSFromSASS($sSassContent, $aImportPaths = array(), $aVariables = array())
{
$oSass = new Compiler();//['checkImportResolutions'=>true]);
$oSass = new Compiler();
$oSass->setOutputStyle(OutputStyle::COMPRESSED);
// Setting our variables
$aCssVariable = [];
foreach ($aVariables as $entry=>$value) {
$aCssVariable[$entry] = ValueConverter::parseValue($value);
$aScssVariables = [];
foreach ($aVariables as $entry => $value) {
$aScssVariables[$entry] = ValueConverter::parseValue($value);
}
$oSass->addVariables($aCssVariable);
$oSass->addVariables($aScssVariables);
// Setting our imports paths
$oSass->setImportPaths($aImportPaths);
// Temporary disabling max exec time while compiling
$iCurrentMaxExecTime = (int) ini_get('max_execution_time');
set_time_limit(0);
// Compiling SASS
//checkImportResolutions
$sCss = $oSass->compileString($sSassContent);
set_time_limit(intval($iCurrentMaxExecTime));
@@ -2845,6 +2844,36 @@ HTML;
return strlen($sString ?? '');
}
/**
* Helper around the native strlen() PHP method to test a string for null or empty value
*
* @link https://www.php.net/releases/8.1/en.php#deprecations_and_bc_breaks "Passing null to non-nullable internal function parameters is deprecated"
*
* @param string|null $sString
*
* @return bool if string null or empty
* @since 3.0.2 N°5302
*/
public static function IsNullOrEmptyString(?string $sString): bool
{
return $sString === null || strlen($sString) === 0;
}
/**
* Helper around the native strlen() PHP method to test a string not null or empty value
*
* @link https://www.php.net/releases/8.1/en.php#deprecations_and_bc_breaks "Passing null to non-nullable internal function parameters is deprecated"
*
* @param string|null $sString
*
* @return bool if string is not null and not empty
* @since 3.0.2 N°5302
*/
public static function IsNotNullOrEmptyString(?string $sString): bool
{
return !static::IsNullOrEmptyString($sString);
}
//----------------------------------------------
// Environment helpers
//----------------------------------------------