/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
- * Copyright (c) 2001-2014 *
+ * Copyright (c) 2001-2016 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
// Cas 1. forcer_lang = true et pas de critere {lang_select}
if (isset($GLOBALS['forcer_lang']) AND $GLOBALS['forcer_lang']
AND $lang_select !== 'oui')
- return;
+ $lang = $GLOBALS['spip_lang'];
// Cas 2. l'objet n'a pas de langue definie (ou definie a '')
- if (!strlen($lang))
- return;
+ elseif (!strlen($lang))
+ $lang = $GLOBALS['spip_lang'];
// Cas 3. l'objet est multilingue !
- if ($lang_select !== 'oui'
- AND strlen($titre) > 10
- AND strpos($titre, '<multi>') !== false
- AND strpos(echappe_html($titre), '<multi>') !== false)
- return;
-
- // Tous les cas ayant ete elimines, faire le job
- $GLOBALS['spip_lang'] = $lang;
+ elseif ($lang_select !== 'oui'
+ AND strlen($titre) > 10
+ AND strpos($titre, '<multi>') !== false
+ AND strpos(echappe_html($titre), '<multi>') !== false)
+ $lang = $GLOBALS['spip_lang'];
+
+ // faire un lang_select() eventuellement sur la langue inchangee
+ lang_select($lang);
+
return;
}