diff --git a/ajax/actorinformation.php b/ajax/actorinformation.php
index 58609f70107..4537875b841 100644
--- a/ajax/actorinformation.php
+++ b/ajax/actorinformation.php
@@ -122,12 +122,12 @@
$ticket = new Ticket();
$url = $ticket->getSearchURL() . "?" . Toolbox::append_params($options2, '&');
-$nb = $ticket->{$method}($actor_id);
+$nb = (int) $ticket->{$method}($actor_id);
if ($only_number) {
echo "" . $nb . "";
} else {
echo " (";
- printf(__('%1$s: %2$s'), __('Processing'), $nb);
+ printf(__s('%1$s: %2$s'), __('Processing'), $nb);
echo ")";
}
diff --git a/ajax/central.php b/ajax/central.php
index 8f831d8ba1b..1c9023e429c 100644
--- a/ajax/central.php
+++ b/ajax/central.php
@@ -94,5 +94,5 @@
}
break;
default:
- echo __('Invalid widget');
+ echo __s('Invalid widget');
}
diff --git a/ajax/comments.php b/ajax/comments.php
index 6fadc953ff2..5119295715d 100644
--- a/ajax/comments.php
+++ b/ajax/comments.php
@@ -84,9 +84,9 @@
echo(implode("
", $comments));
if (isset($_POST['withlink']) && $link !== null) {
- echo "\n";
+ echo "";
}
break;
@@ -125,19 +125,19 @@
}
$tmpname = Dropdown::getDropdownName($table, $_POST["value"], 1);
if (is_array($tmpname) && isset($tmpname["comment"])) {
- echo $tmpname["comment"];
+ echo htmlspecialchars($tmpname["comment"]);
}
if (isset($_POST['withlink'])) {
- echo "\n";
+ echo "";
}
if (isset($_POST['with_dc_position'])) {
$item = getItemForItemtype($_POST['itemtype']);
- echo "\n";
+ echo "";
}
}
}
diff --git a/ajax/dcroom_size.php b/ajax/dcroom_size.php
index 2c8a6b6cf6e..69386fff31e 100644
--- a/ajax/dcroom_size.php
+++ b/ajax/dcroom_size.php
@@ -61,5 +61,5 @@
]
);
} else {
- echo "
" . __('No room found or selected') . "
";
+ echo "" . __s('No room found or selected') . "
";
}
diff --git a/ajax/dropdownAllItems.php b/ajax/dropdownAllItems.php
index 32afa59db7a..c6a96184bc8 100644
--- a/ajax/dropdownAllItems.php
+++ b/ajax/dropdownAllItems.php
@@ -123,6 +123,6 @@
$params
);
- echo "
\n";
+ echo "
";
}
}
diff --git a/ajax/dropdownConnectNetworkPortDeviceType.php b/ajax/dropdownConnectNetworkPortDeviceType.php
index 362630262e6..a5bc8c62898 100644
--- a/ajax/dropdownConnectNetworkPortDeviceType.php
+++ b/ajax/dropdownConnectNetworkPortDeviceType.php
@@ -82,5 +82,5 @@
Dropdown::show($_POST['itemtype'], $params);
echo "";
- echo "\n";
+ echo "";
}
diff --git a/ajax/dropdownItilActors.php b/ajax/dropdownItilActors.php
index cacd3ff5d73..30dfdd701be 100644
--- a/ajax/dropdownItilActors.php
+++ b/ajax/dropdownItilActors.php
@@ -231,7 +231,7 @@
echo '
';
printf(
__('%1$s: %2$s'),
- _n('Email', 'Emails', 1),
+ _sn('Email', 'Emails', 1),
""
);
diff --git a/ajax/dropdownMassiveActionAddValidator.php b/ajax/dropdownMassiveActionAddValidator.php
index fa879a1402e..32e4e283b76 100644
--- a/ajax/dropdownMassiveActionAddValidator.php
+++ b/ajax/dropdownMassiveActionAddValidator.php
@@ -112,7 +112,7 @@
$param
);
- echo "
\n";
+ echo "
";
break;
case $types_mapping['list_users']:
@@ -141,7 +141,7 @@
Dropdown::showFromArray($items_id_name, $users, $param);
- echo "
" . __('Comments') . " ";
+ echo "
" . __s('Comments') . " ";
echo " ";
echo "";
diff --git a/ajax/dropdownShowIPNetwork.php b/ajax/dropdownShowIPNetwork.php
index b441a987034..cdc8900da3c 100644
--- a/ajax/dropdownShowIPNetwork.php
+++ b/ajax/dropdownShowIPNetwork.php
@@ -39,8 +39,8 @@
$network = new IPNetwork();
if ($_POST['ipnetworks_id'] && $network->can($_POST['ipnetworks_id'], READ)) {
- echo "
\n";
- echo "" . $network->fields['completename'] . "
\n";
+ echo "
";
+ echo "" . htmlspecialchars($network->fields['completename']) . "
";
$address = $network->getAddress()->getTextual();
$netmask = $network->getNetmask()->getTextual();
@@ -52,10 +52,10 @@
$network->computeNetworkRange($start, $end);
//TRANS: %1$s is address, %2$s is netmask
- printf(__('IP network: %1$s/%2$s') . "
\n", $address, $netmask);
- printf(__('First/last addresses: %1$s/%2$s'), $start->getTextual(), $end->getTextual());
+ printf(__s('IP network: %1$s/%2$s') . "
", $address, $netmask);
+ printf(__s('First/last addresses: %1$s/%2$s'), $start->getTextual(), $end->getTextual());
if (!empty($gateway)) {
- echo "
\n";
- printf(__('Gateway: %s') . "\n", $gateway);
+ echo "
";
+ printf(__s('Gateway: %s') . "\n", $gateway);
}
}
diff --git a/ajax/getMapPoint.php b/ajax/getMapPoint.php
index 094119272de..fadb9280676 100644
--- a/ajax/getMapPoint.php
+++ b/ajax/getMapPoint.php
@@ -42,7 +42,7 @@
if (!isset($_POST['itemtype']) || !isset($_POST['items_id']) || (int)$_POST['items_id'] < 1) {
$result = [
'success' => false,
- 'message' => __('Required argument missing!')
+ 'message' => __s('Required argument missing!')
];
} else {
$itemtype = $_POST['itemtype'];
@@ -57,7 +57,7 @@
} else {
$result = [
'success' => false,
- 'message' => __('Element seems not geolocalized or cannot be found')
+ 'message' => __s('Element seems not geolocalized or cannot be found')
];
}
}
@@ -76,7 +76,7 @@
$result = [
'success' => false,
'message' => "" . __("Location seems not geolocalized!") . "
" .
- "" . __("Consider filling latitude and longitude on this location.") . ""
+ "" . __s("Consider filling latitude and longitude on this location.") . ""
];
}
}
diff --git a/ajax/massiveaction.php b/ajax/massiveaction.php
index 6d6cf4449d8..89f9f50a79e 100644
--- a/ajax/massiveaction.php
+++ b/ajax/massiveaction.php
@@ -73,7 +73,7 @@
}
$rand = mt_rand();
- echo "";
+ echo "";
echo " ";
$actions = ['-1' => Dropdown::EMPTY_VALUE] + $actions;
diff --git a/ajax/priority.php b/ajax/priority.php
index c5cc6d03384..94331e43150 100644
--- a/ajax/priority.php
+++ b/ajax/priority.php
@@ -56,10 +56,10 @@
} elseif ($_REQUEST["priority"]) {
// Send UTF8 Headers
header("Content-Type: text/html; charset=UTF-8");
- echo "";
+ echo "";
} else {
- echo Ticket::getPriorityName($priority);
+ echo htmlspecialchars(Ticket::getPriorityName($priority));
}
}
diff --git a/ajax/private_public.php b/ajax/private_public.php
index e30fe0cce23..abb6578f5f2 100644
--- a/ajax/private_public.php
+++ b/ajax/private_public.php
@@ -48,7 +48,7 @@
echo "\n";
$private = __('Personal');
$link = "" . __('Set public') . "";
- printf(__('%1$s - %2$s'), $private, $link);
+ printf(__s('%1$s - %2$s'), $private, $link);
break;
case false:
@@ -63,13 +63,13 @@
echo "";
echo "";
echo "\n";
- echo __('Public');
+ echo __s('Public');
echo " | ";
Entity::dropdown(['value' => $val]);
- echo " | " . __('Child entities') . " | ";
+ echo " | " . __s('Child entities') . " | ";
Dropdown::showYesNo('is_recursive', $_POST["is_recursive"]);
echo " | ";
- echo "" . __('Set personal') . "";
+ echo "" . __s('Set personal') . "";
echo " |
";
break;
}
diff --git a/ajax/resaperiod.php b/ajax/resaperiod.php
index 6673200bc54..523fc7db6aa 100644
--- a/ajax/resaperiod.php
+++ b/ajax/resaperiod.php
@@ -50,13 +50,13 @@
echo "";
switch ($_POST['type']) {
case 'day':
- echo "" . __('End date') . ' | ';
+ echo " |
" . __s('End date') . ' | ';
Html::showDateField('periodicity[end]', ['value' => $_POST['end']]);
echo " |
";
break;
case 'week':
- echo "" . __('End date') . ' | ';
+ echo " |
" . __s('End date') . ' | ';
Html::showDateField('periodicity[end]', ['value' => $_POST['end']]);
echo " |
";
echo "";
diff --git a/ajax/subvisibility.php b/ajax/subvisibility.php
index fc0ddd78ae0..837d162a7b1 100644
--- a/ajax/subvisibility.php
+++ b/ajax/subvisibility.php
@@ -62,7 +62,7 @@
$params['toadd'] = [-1 => __('No restriction')];
}
echo "