Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
Molkobain
2024-01-29 15:07:10 +01:00
10 changed files with 32 additions and 25 deletions

View File

@@ -22,13 +22,13 @@ $iElapsed = time() - $iBeginTime;
if (count($aFailedCommands))
{
fwrite(STDERR, "\nafterBuild execution failed! (in ${iElapsed}s)\n");
fwrite(STDERR, "\nafterBuild execution failed! (in {$iElapsed}s)\n");
fwrite(STDERR, "List of failling commands:\n - " . implode("\n - ", $aFailedCommands) . "\n");
exit(1);
}
echo "\nDone (${iElapsed}s)\n";
echo "\nDone ({$iElapsed}s)\n";
exit(0);
/**
@@ -74,7 +74,7 @@ function ExecCommand($cmd) {
}
else
{
echo "| elapsed:${iElapsed}s \n";
echo "| elapsed:{$iElapsed}s \n";
}
if (!empty($stderr))

View File

@@ -910,13 +910,13 @@ class LoginWebPage extends NiceWebPage
$aAllProfiles = array();
while ($oProfile = $oProfilesSet->Fetch())
{
$aAllProfiles[strtolower($oProfile->GetName())] = $oProfile->GetKey();
$aAllProfiles[mb_strtolower($oProfile->GetName())] = $oProfile->GetKey();
}
$aProfiles = array();
foreach ($aRequestedProfiles as $sRequestedProfile)
{
$sRequestedProfile = strtolower($sRequestedProfile);
$sRequestedProfile = mb_strtolower($sRequestedProfile);
if (isset($aAllProfiles[$sRequestedProfile]))
{
$aProfiles[] = $aAllProfiles[$sRequestedProfile];

View File

@@ -521,6 +521,6 @@ class Str
public static function islowcase($sString)
{
return (strtolower($sString) == $sString);
return (mb_strtolower($sString) == $sString);
}
}

View File

@@ -677,10 +677,11 @@ class ActionEmail extends ActionNotification
if (isset($aContextArgs['attachments']))
{
$aAttachmentReport = array();
/** @var \ormDocument $oDocument */
foreach($aContextArgs['attachments'] as $oDocument)
{
$aMessageContent['attachments'][] = ['data' => $oDocument->GetData(), 'filename' => $oDocument->GetFileName(), 'mime_type' => $oDocument->GetMimeType()];
$aAttachmentReport[] = array($oDocument->GetFileName(), $oDocument->GetMimeType(), strlen($oDocument->GetData()));
$aAttachmentReport[] = array($oDocument->GetFileName(), $oDocument->GetMimeType(), strlen($oDocument->GetData() ?? ''));
}
$oLog->Set('attachments', $aAttachmentReport);
}

View File

@@ -3506,7 +3506,7 @@ class AttributeBoolean extends AttributeInteger
$sProposedValue, $bLocalizedValue = false, $sSepItem = null, $sSepAttribute = null, $sSepValue = null,
$sAttributeQualifier = null
) {
$sInput = strtolower(trim($sProposedValue));
$sInput = mb_strtolower(trim($sProposedValue));
if ($bLocalizedValue)
{
switch ($sInput)

View File

@@ -64,16 +64,22 @@ class DesignDocument extends DOMDocument
/**
* Overload of the standard API
*
* @param $filename
* @param string $filename
* @param int $options
*
* @return bool
*/
public function load($filename, $options = null)
public function load(string $filename, int $options = 0): bool
{
libxml_clear_errors();
if (parent::load($filename, LIBXML_NOBLANKS) === false) {
$aErrors = libxml_get_errors();
IssueLog::Error("Error loading $filename", LogAPI::CHANNEL_DEFAULT, $aErrors);
return false;
}
return true;
}
/**

View File

@@ -739,7 +739,7 @@ class PHP_ParserGenerator
while (isset($errmsg[$restart]) && $errmsg[$restart] == ' ') {
$restart++;
}
printf("%s%.${end}s\n", $prefix, $errmsg);
printf("%s%.{$end}s\n", $prefix, $errmsg);
$errmsg = substr($errmsg, $restart);
}
}
@@ -771,7 +771,7 @@ class PHP_ParserGenerator
for ($j = $i; $j < $this->nsymbol; $j += $skip) {
$sp = $this->symbols[$j];
//assert( sp->index==j );
printf(" %3d %-${maxlen}.${maxlen}s", $j, $sp->name);
printf(" %3d %-{$maxlen}.{$maxlen}s", $j, $sp->name);
}
print "\n";
}

View File

@@ -231,19 +231,19 @@ class PHP_ParserGenerator_Action
switch ($this->type)
{
case self::SHIFT:
fprintf($fp, "%${indent}s shift %d", $this->sp->name, $this->x->statenum);
fprintf($fp, "%{$indent}s shift %d", $this->sp->name, $this->x->statenum);
break;
case self::REDUCE:
fprintf($fp, "%${indent}s reduce %d", $this->sp->name, $this->x->index);
fprintf($fp, "%{$indent}s reduce %d", $this->sp->name, $this->x->index);
break;
case self::ACCEPT:
fprintf($fp, "%${indent}s accept", $this->sp->name);
fprintf($fp, "%{$indent}s accept", $this->sp->name);
break;
case self::ERROR:
fprintf($fp, "%${indent}s error", $this->sp->name);
fprintf($fp, "%{$indent}s error", $this->sp->name);
break;
case self::CONFLICT:
fprintf($fp, "%${indent}s reduce %-3d ** Parsing conflict **", $this->sp->name, $this->x->index);
fprintf($fp, "%{$indent}s reduce %-3d ** Parsing conflict **", $this->sp->name, $this->x->index);
break;
case self::SH_RESOLVED:
case self::RD_RESOLVED:

View File

@@ -488,7 +488,7 @@ class CASUserProvisioning
$aAllProfiles = array();
while($oProfile = $oProfilesSet->Fetch())
{
$aAllProfiles[strtolower($oProfile->GetName())] = $oProfile->GetKey();
$aAllProfiles[mb_strtolower($oProfile->GetName())] = $oProfile->GetKey();
}
// Translate the CAS/LDAP group names into iTop profile names
@@ -498,9 +498,9 @@ class CASUserProvisioning
{
if (preg_match($sPattern, $sGroupName, $aMatches))
{
if (array_key_exists(strtolower($aMatches[1]), $aAllProfiles))
if (array_key_exists(mb_strtolower($aMatches[1]), $aAllProfiles))
{
$aProfiles[] = $aAllProfiles[strtolower($aMatches[1])];
$aProfiles[] = $aAllProfiles[mb_strtolower($aMatches[1])];
phpCAS::log("Info: Adding the profile '{$aMatches[1]}' from CAS.");
}
else
@@ -522,10 +522,10 @@ class CASUserProvisioning
$aCASDefaultProfiles = explode(';', $sCASDefaultProfiles);
foreach($aCASDefaultProfiles as $sDefaultProfileName)
{
if (array_key_exists(strtolower($sDefaultProfileName), $aAllProfiles))
if (array_key_exists(mb_strtolower($sDefaultProfileName), $aAllProfiles))
{
$aProfiles[] = $aAllProfiles[strtolower($sDefaultProfileName)];
phpCAS::log("Info: Adding the default profile '".$aAllProfiles[strtolower($sDefaultProfileName)]."' from CAS.");
$aProfiles[] = $aAllProfiles[mb_strtolower($sDefaultProfileName)];
phpCAS::log("Info: Adding the default profile '".$aAllProfiles[mb_strtolower($sDefaultProfileName)]."' from CAS.");
}
else
{

View File

@@ -345,7 +345,7 @@ abstract class ItopTestCase extends TestCase
foreach ($class->getProperties() as $property) {
if (!$property->isStatic()) continue;
$property->setAccessible(true);
$property->setValue(static::$aBackupStaticProperties[$sClass][$property->getName()]);
$property->setValue(null, static::$aBackupStaticProperties[$sClass][$property->getName()]);
}
}
@@ -381,7 +381,7 @@ abstract class ItopTestCase extends TestCase
public function SetNonPublicStaticProperty(string $sClass, string $sProperty, $value)
{
$oProperty = $this->GetProperty($sClass, $sProperty);
$oProperty->setValue($value);
$oProperty->setValue(null, $value);
}
public static function RecurseRmdir($dir)