[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/exec/ -> valider_xml.php (source)

   1  <?php
   2  
   3  /***************************************************************************\
   4   *  SPIP, Systeme de publication pour l'internet                           *
   5   *                                                                         *
   6   *  Copyright (c) 2001-2007                                                *
   7   *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
   8   *                                                                         *
   9   *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
  10   *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
  11  \***************************************************************************/
  12  
  13  if (!defined("_ECRIRE_INC_VERSION")) return;
  14  include_spip('inc/presentation');
  15  
  16  // http://doc.spip.org/@exec_valider_xml_dist
  17  function exec_valider_xml_dist()
  18  {
  19      if ($GLOBALS['connect_statut'] != '0minirezo') {
  20          echo minipres();
  21          exit;
  22      }
  23  
  24      $url = urldecode(_request('var_url'));
  25  
  26      if (!$url) {
  27        $url_aff = 'http://';
  28        $onfocus = "this.value='';";
  29        $texte = $err = '';
  30  
  31      } else {
  32  
  33        list($server, $script) = preg_split('/[?]/', $url);
  34        if ((!$server) OR ($server == './') 
  35            OR strpos($server, url_de_base()) === 0) {
  36                  include_spip('inc/headers');
  37                  redirige_par_entete(parametre_url($url,'transformer_xml','valider_xml', '&'));
  38        }
  39  
  40        include_spip('public/debug');
  41        include_spip('inc/distant');
  42        $url_aff = entites_html($url);
  43        $onfocus = "this.value='" . addslashes($url) . "';";
  44  
  45        $transformer_xml = charger_fonction('valider_xml', 'inc');
  46  
  47        if (preg_match(',^[a-z][0-9a-z_]*$,i', $url))
  48          $texte = $transformer_xml(charger_fonction($url, 'exec'), true);
  49        else     $texte = $transformer_xml(recuperer_page($url));
  50  
  51        if (isset($GLOBALS['xhtml_error'])) 
  52            list($texte, $err) = emboite_texte($texte);
  53        else {
  54          $err = '<h3>' . _T('spip_conforme_dtd') . '</h3>';
  55          list($texte, ) = emboite_texte($texte);
  56        }
  57      }
  58      $titre = _T('analyse_xml');
  59      $commencer_page = charger_fonction('commencer_page', 'inc');
  60      echo $commencer_page($titre);
  61  
  62      echo "<div style='margin: 10px; text-align: center'>", "<h1>", $titre, '</h1>';
  63      echo "<form style='margin: 0px;' action='", generer_url_ecrire('valider_xml') . "'>";
  64      echo "<div><input type='hidden' name='exec' value='valider_xml' />";
  65      echo '<input type="text" size="70" value="',$url_aff,'" name="var_url" onfocus="'.$onfocus . '" />';
  66      echo "</div></form>";
  67  
  68      echo  $err, "</div>";
  69      echo "<div style='margin: 10px; text-align: left'>",$texte, '</div>', fin_page();
  70  }
  71  ?>


Généré le : Wed Nov 21 10:20:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics