[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / public / composer.php
index 71aca21..f96e8fb 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  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.     *
@@ -421,21 +421,22 @@ function lang_select_public($lang, $lang_select, $titre=null) {
        // 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;
 }