diff --git a/ecrire/exec/valider_xml.php b/ecrire/exec/valider_xml.php index 8ef7f04cba26e6626a756718ab304adf0dbfad4f..4328eefb0d14703b9d312f8a104d6229e827b9bd 100644 --- a/ecrire/exec/valider_xml.php +++ b/ecrire/exec/valider_xml.php @@ -204,12 +204,10 @@ function valider_skel($transformer_xml, $file, $dir) list($texte, $err) = $transformer_xml($page['texte']); $res = strlen($texte); $script = basename($file,'.html'); - $url = ''; // pas de validation solitaire pour les squelettes internes, a revoir. if (substr_count($dir, '/') <= 1) { - foreach($contexte as $k => $v) $url .= '&' . $k . '=' . $v; - $url = generer_url_public($script, substr($url,1)); - } + $url = generer_url_public($script, $contexte); + } else $url = ''; return array(count($err), $res, $err, $script, $url); } diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index 6233a6661ebf317966fcde8897f2a858d328b3a3..d998f564182ce5737594bf7956cc4b3a23e0e509 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -852,18 +852,23 @@ function get_spip_script($default='') { } // http://doc.spip.org/@generer_url_public -function generer_url_public($script='', $args="", $no_entities=false, $rel=false) { +function generer_url_public($script='', $args="", $no_entities=false, $rel=false, $action='') { // si le script est une action (spip_pass, spip_inscription), // standardiser vers la nouvelle API - $action = get_spip_script(); + if (!$action) $action = get_spip_script(); if ($script) $action = parametre_url($action, _SPIP_PAGE, $script, '&'); - if ($args) + if ($args) { + if (is_array($args)) { + $r = ''; + foreach($args as $k => $v) $r .= '&' . $k . '=' . $v; + $args = substr($r,1); + } $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; - + } if (!$no_entities) $action = quote_amp($action); @@ -873,18 +878,7 @@ function generer_url_public($script='', $args="", $no_entities=false, $rel=false // http://doc.spip.org/@generer_url_prive function generer_url_prive($script, $args="", $no_entities=false) { - $action = 'prive.php'; - if ($script) - $action = parametre_url($action, _SPIP_PAGE, $script, '&'); - - if ($args) - $action .= - (strpos($action, '?') !== false ? '&' : '?') . $args; - - if (!$no_entities) - $action = quote_amp($action); - - return url_de_base() . _DIR_RESTREINT_ABS . $action; + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); } // Pour les formulaires en methode POST,