[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / ecrire / balise / url_.php
index 1533b1a..833b492 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2012                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -123,7 +123,7 @@ function balise_URL_SITE_dist($p)
 // http://doc.spip.org/@balise_URL_SITE_SPIP_dist
 function balise_URL_SITE_SPIP_dist($p) {
        $p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
-       $p->code = "htmlspecialchars(".$p->code.")";
+       $p->code = "spip_htmlspecialchars(".$p->code.")";
        $p->interdire_scripts = false;
        return $p;
 }
@@ -171,18 +171,24 @@ function balise_URL_PAGE_dist($p) {
 
 //
 // #URL_ECRIRE{rubriques} -> ecrire/?exec=rubriques
-//
+// #URL_ECRIRE*  meme chose, mais sans convertir les & en &
 // http://doc.spip.org/@balise_URL_ECRIRE_dist
 function balise_URL_ECRIRE_dist($p) {
 
        $code = interprete_argument_balise(1,$p);
-       if (!$code)
+       if (!$code) {
                $fonc = "''";
-       else{
+       }
+       else {
                $fonc = $code;
                $args = interprete_argument_balise(2,$p);
-               if ($args != "''" && $args!==NULL)
-                       $fonc .= ',' . $args;
+               if ($args === NULL) {
+                       $args = "''";
+               }
+               $noentities = $p->etoile ? ", true" : '';
+               if (($args != "''")  OR $noentities) {
+                       $fonc .= ",$args$noentities";
+               }
        }
        $p->code = 'generer_url_ecrire(' . $fonc .')';
        $p->interdire_scripts = false;
@@ -201,8 +207,11 @@ function balise_URL_ACTION_AUTEUR_dist($p) {
        if ($args != "''" && $args!==NULL)
                $p->code .= ",".$args;
        $redirect = interprete_argument_balise(3,$p);
-       if ($redirect != "''" && $redirect!==NULL)
+       if ($redirect != "''" && $redirect!==NULL) {
+               if ($args == "''" || $args===NULL)
+                       $p->code .= ",''";
                $p->code .= ",".$redirect;
+       }
 
        $p->code = "generer_action_auteur(" . $p->code . ")";
        $p->interdire_scripts = false;