N°6037 - PHP 8.2: Migrate usages of strtolower() and strtolower() that depends on current locale

This commit is contained in:
Molkobain
2024-01-26 16:36:25 +01:00
parent 8eca200023
commit 8928a87b14
4 changed files with 10 additions and 10 deletions

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

@@ -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

@@ -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
{