diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php
index 845077ac0..bdb66fc1f 100644
--- a/addons/userrights/userrightsprofile.class.inc.php
+++ b/addons/userrights/userrightsprofile.class.inc.php
@@ -265,7 +265,7 @@ class URP_Profiles extends UserRightsBaseClassGUI
function DoShowGrantSumary($oPage)
{
- if ($this->GetName() == "Administrator")
+ if ($this->GetRawName() == "Administrator")
{
// Looks dirty, but ok that's THE ONE
$oPage->p(Dict::S('UI:UserManagement:AdminProfile+'));
diff --git a/addons/userrights/userrightsprojection.class.inc.php b/addons/userrights/userrightsprojection.class.inc.php
index 408bf478d..08810e389 100644
--- a/addons/userrights/userrightsprojection.class.inc.php
+++ b/addons/userrights/userrightsprojection.class.inc.php
@@ -97,7 +97,7 @@ class URP_Profiles extends UserRightsBaseClass
function DoShowGrantSumary($oPage)
{
- if ($this->GetName() == "Administrator")
+ if ($this->GetRawName() == "Administrator")
{
// Looks dirty, but ok that's THE ONE
$oPage->p(Dict::S('UI:UserManagement:AdminProfile+'));
diff --git a/application/applicationcontext.class.inc.php b/application/applicationcontext.class.inc.php
index 12ea702b1..519e3760e 100644
--- a/application/applicationcontext.class.inc.php
+++ b/application/applicationcontext.class.inc.php
@@ -163,7 +163,7 @@ class ApplicationContext
$sContext = "";
foreach($this->aValues as $sName => $sValue)
{
- $sContext .= "\n";
+ $sContext .= "\n";
}
return $sContext;
}
diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php
index 91483b1f0..76aaade5a 100644
--- a/application/cmdbabstract.class.inc.php
+++ b/application/cmdbabstract.class.inc.php
@@ -581,7 +581,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
$oTemplate = new DisplayTemplate($sTemplate);
// Note: to preserve backward compatibility with home-made templates, the placeholder '$pkey$' has been preserved
// but the preferred method is to use '$id$'
- $oTemplate->Render($oPage, array('class_name'=> MetaModel::GetName(get_class($this)),'class'=> get_class($this), 'pkey'=> $this->GetKey(), 'id'=> $this->GetKey(), 'name' => $this->Get('friendlyname')));
+ $oTemplate->Render($oPage, array('class_name'=> MetaModel::GetName(get_class($this)),'class'=> get_class($this), 'pkey'=> $this->GetKey(), 'id'=> $this->GetKey(), 'name' => $this->GetName()));
}
else
{
@@ -1473,14 +1473,14 @@ EOF
$aEventsList[] ='validate';
$aEventsList[] ='keyup';
$aEventsList[] ='change';
- $sHTMLValue = " {$sValidationField}";
+ $sHTMLValue = " {$sValidationField}";
break;
case 'DateTime':
$aEventsList[] ='validate';
$aEventsList[] ='keyup';
$aEventsList[] ='change';
- $sHTMLValue = " {$sValidationField}";
+ $sHTMLValue = " {$sValidationField}";
break;
case 'Duration':
@@ -1495,7 +1495,7 @@ EOF
$sHours = "";
$sMinutes = "";
$sSeconds = "";
- $sHidden = "";
+ $sHidden = "";
$sHTMLValue = Dict::Format('UI:DurationForm_Days_Hours_Minutes_Seconds', $sDays, $sHours, $sMinutes, $sSeconds).$sHidden." ".$sValidationField;
$oPage->add_ready_script("$('#{$iId}').bind('update', function(evt, sFormId) { return ToggleDurationField('$iId'); });");
break;
@@ -1504,7 +1504,7 @@ EOF
$aEventsList[] ='validate';
$aEventsList[] ='keyup';
$aEventsList[] ='change';
- $sHTMLValue = " {$sValidationField}";
+ $sHTMLValue = " {$sValidationField}";
break;
case 'Text':
@@ -1528,7 +1528,7 @@ EOF
{
$sStyle = 'style="'.implode('; ', $aStyles).'"';
}
- $sHTMLValue = "
";
+ $sHTMLValue = "";
break;
case 'CaseLog':
@@ -1553,7 +1553,7 @@ EOF
$sPreviousLog = is_object($value) ? $value->GetAsHTML() : '';
$iEntriesCount = is_object($value) ? count($value->GetIndex()) : 0;
$sHidden = ""; // To know how many entries the case log already contains
- $sHTMLValue = "| $sHeader$sPreviousLog | {$sValidationField} |
$sHidden
";
+ $sHTMLValue = "| $sHeader$sPreviousLog | {$sValidationField} |
$sHidden
";
$oPage->add_ready_script("$('#$iId').bind('keyup change validate', function(evt, sFormId) { return ValidateCaseLogField('$iId', $bMandatory, sFormId) } );"); // Custom validation function
break;
@@ -1580,7 +1580,7 @@ EOF
}
$iMaxFileSize = utils::ConvertToBytes(ini_get('upload_max_filesize'));
$sHTMLValue = "\n";
- $sHTMLValue .= "\n";
+ $sHTMLValue .= "\n";
$sHTMLValue .= "$sFileName
\n";
$sHTMLValue .= " {$sValidationField}\n";
break;
@@ -1654,7 +1654,7 @@ EOF
}
else
{
- $sHTMLValue = " {$sValidationField}";
+ $sHTMLValue = " {$sValidationField}";
$aEventsList[] ='keyup';
$aEventsList[] ='change';
}
diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php
index 44ff08c3f..767c0208c 100644
--- a/application/displayblock.class.inc.php
+++ b/application/displayblock.class.inc.php
@@ -1034,7 +1034,7 @@ class HistoryBlock extends DisplayBlock
$aValues = array();
foreach($aChanges as $aChange)
{
- $aValues[] = array('date' => $aChange['date'], 'userinfo' => $aChange['userinfo'], 'log' => "- ".implode('
- ', $aChange['log'])."
");
+ $aValues[] = array('date' => $aChange['date'], 'userinfo' => htmlentities($aChange['userinfo']), 'log' => "- ".implode('
- ', $aChange['log'])."
");
}
$sHtml .= $oPage->GetTable($aAttribs, $aValues);
return $sHtml;
@@ -1135,7 +1135,7 @@ class MenuBlock extends DisplayBlock
$this->AddMenuSeparator($aActions);
// Static menus: Email this page & CSV Export
$sUrl = ApplicationContext::MakeObjectUrl($sClass, $id);
- $aActions['UI:Menu:EMail'] = array ('label' => Dict::S('UI:Menu:EMail'), 'url' => "mailto:?subject=".$oObj->GetName()."&body=".urlencode($sUrl));
+ $aActions['UI:Menu:EMail'] = array ('label' => Dict::S('UI:Menu:EMail'), 'url' => "mailto:?subject=".urlencode($oObj->GetRawName())."&body=".urlencode($sUrl));
$aActions['UI:Menu:CSVExport'] = array ('label' => Dict::S('UI:Menu:CSVExport'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=search&filter=$sFilter&format=csv{$sContext}");
}
$this->AddMenuSeparator($aActions);
diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php
index ad622d900..679a00f08 100644
--- a/application/loginwebpage.class.inc.php
+++ b/application/loginwebpage.class.inc.php
@@ -141,7 +141,6 @@ EOF
public function DisplayChangePwdForm($bFailedLogin = false)
{
$sAuthUser = utils::ReadParam('auth_user', '', false, 'raw_data');
- $sAuthPwd = utils::ReadParam('suggest_pwd', '', false, 'raw_data');
$sVersionShort = Dict::Format('UI:iTopVersion:Short', ITOP_VERSION);
$sInconsistenPwdMsg = Dict::S('UI:Login:RetypePwdDoesNotMatch');
diff --git a/application/portalwebpage.class.inc.php b/application/portalwebpage.class.inc.php
index 0ce8df78c..77e97603a 100644
--- a/application/portalwebpage.class.inc.php
+++ b/application/portalwebpage.class.inc.php
@@ -288,7 +288,7 @@ EOF
{
$aRow = array();
- $aRow['key'] = ''.$oObj->Get('friendlyname').'';
+ $aRow['key'] = ''.$oObj->GetName().'';
$sHilightClass = $oObj->GetHilightClass();
if ($sHilightClass != '')
{
diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php
index f64560343..0101aae1d 100644
--- a/application/ui.extkeywidget.class.inc.php
+++ b/application/ui.extkeywidget.class.inc.php
@@ -133,7 +133,7 @@ class UIExtKeyWidget
$aAllowedValues = array();
while($oObj = $oAllowedValues->Fetch())
{
- $aAllowedValues[$oObj->GetKey()] = $oObj->Get('friendlyname');
+ $aAllowedValues[$oObj->GetKey()] = $oObj->GetName();
}
$sHTMLValue = $oPage->GetRadioButtons($aAllowedValues, $value, $this->iId, "{$sAttrFieldPrefix}{$sFieldName}", $bMandatory, $bVertical, $sValidationField);
$aEventsList[] ='change';
@@ -159,7 +159,7 @@ class UIExtKeyWidget
while($oObj = $oAllowedValues->Fetch())
{
$key = $oObj->GetKey();
- $display_value = $oObj->Get('friendlyname');
+ $display_value = $oObj->GetName();
if (($oAllowedValues->Count() == 1) && ($bMandatory == 'true') )
{
@@ -326,11 +326,11 @@ EOF
{
throw new Exception('Implementation: null value for allowed values definition');
}
- $oValuesSet = new ValueSetObjects($sFilter);
+ $oValuesSet = new ValueSetObjects($sFilter, 'friendlyname'); // Bypass GetName() to avoid the encoding by htmlentities
$aValues = $oValuesSet->GetValues(array('this' => $oObj), $sContains);
foreach($aValues as $sKey => $sFriendlyName)
{
- $oP->add(trim($sFriendlyName)."|".$sKey."\n");
+ $oP->add(trim($sFriendlyName)."\t".$sKey."\n");
}
}
diff --git a/application/uilinkswizard.class.inc.php b/application/uilinkswizard.class.inc.php
index b44d5cbfe..d703790f5 100644
--- a/application/uilinkswizard.class.inc.php
+++ b/application/uilinkswizard.class.inc.php
@@ -85,7 +85,7 @@ class UILinksWizard
$sTargetClass = $oAttDef->GetTargetClass();
$oTargetObj = MetaModel::GetObject($sTargetClass, $this->m_iObjectId);
- $oP->set_title("iTop - ".MetaModel::GetName($this->m_sLinkedClass)." objects linked with ".MetaModel::GetName(get_class($oTargetObj)).": ".$oTargetObj->GetName());
+ $oP->set_title("iTop - ".MetaModel::GetName($this->m_sLinkedClass)." objects linked with ".MetaModel::GetName(get_class($oTargetObj)).": ".$oTargetObj->GetRawName());
$oP->add("\n");
$oP->add("