Skip to content
Extraits de code Groupes Projets
Valider e3ece7de rédigé par marcimat's avatar marcimat
Parcourir les fichiers

Complément à r23731 : en présence du plugin 'dev' ou du mode 'traductions' ne...

Complément à r23731 : en présence du plugin 'dev' ou du mode 'traductions' ne pas prendre toutes les chaines de langues comme non traduites !
(Eric)
parent 06559d06
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -822,10 +822,19 @@ function _T($texte, $args = array(), $options = array()) {
*/
function _L($text, $args = array(), $options = array()) {
$f = $text;
$defaut_options = array(
'class' => null,
'sanitize' => true,
);
// support de l'ancien argument $class
if ($options and is_string($options)) {
// support de l'ancien argument $class
$options = array('class' => $options);
} elseif (is_array($options)) {
$options += $defaut_options;
} else {
$options = $defaut_options;
}
if (is_array($args)) {
if (!function_exists('interdire_scripts')) {
include_spip('inc/texte');
......@@ -834,11 +843,11 @@ function _L($text, $args = array(), $options = array()) {
include_spip('inc/texte_mini');
}
foreach ($args as $name => $value) {
if (!isset($options['sanitize']) or $options['sanitize']) {
if ($options['sanitize']) {
$value = echapper_html_suspect($value);
$value = interdire_scripts($value, -1);
}
if (isset($options['class']) and $options['class']) {
if (!empty($options['class'])) {
$value = "<span class='".$options['class']."'>$value</span>";
}
$t = str_replace("@$name@", $value, $text);
......@@ -854,7 +863,7 @@ function _L($text, $args = array(), $options = array()) {
}
}
if (($GLOBALS['test_i18n'] or (_request('var_mode') == 'traduction')) and (!isset($options['class']) or !$options['class'])) {
if (($GLOBALS['test_i18n'] or (_request('var_mode') == 'traduction')) and is_null($options['class'])) {
return "<span class=debug-traduction-erreur>$text</span>";
} else {
return $text;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter