[SPIP] ~maj v3.0.14-->v3.0.17
[ptitvelo/web/www.git] / www / ecrire / public / tracer.php
index 94cdccc..cf0fc9e 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.     *
@@ -41,6 +41,8 @@ function trace_query_chrono($m1, $m2, $query, $result, $serveur='')
        static $tt = 0, $nb=0;
        global $tableau_des_temps;
 
+       include_spip('inc/filtres_mini');
+
        $x = _request('var_mode_objet');
        if (isset($GLOBALS['debug']['aucasou'])) {
                list(, $boucle, $serveur, $contexte) = $GLOBALS['debug']['aucasou'];
@@ -59,7 +61,7 @@ function trace_query_chrono($m1, $m2, $query, $result, $serveur='')
        $tt += $dt;
        $nb++;
 
-       $q = preg_replace('/([a-z)`])\s+([A-Z])/', "$1\n<br />$2",htmlentities($query));
+       $q = preg_replace('/([a-z)`])\s+([A-Z])/', "$1\n<br />$2",spip_htmlentities($query));
        $e =  sql_explain($query, $serveur);
        $r = str_replace('Resource id ','',(is_object($result)?get_class($result):$result));
        $tableau_des_temps[] = array($dt, $nb, $boucle, $q, $e, $r, $contexte);
@@ -134,15 +136,13 @@ function chrono_requete($temps)
                  . join('',$t[$k]);
        }
 
-       $navigation = 
-         _T('zbug_statistiques')
-         . "<table style='text-align: left; border: 1px solid;'><tr><td>"
+       $navigation = array(_T('zbug_statistiques'),
+         "<tr><td>"
                . join("</td></tr>\n<tr><td>", $d)
          . "</td></tr>\n"
          .  (# _request('var_mode_objet') ? '' : 
-            ("<tr><td>" .  count($temps) . "</td><td>" . _T('info_total') . '</td><td class="time">' . $total . "</td><td></td></tr>"))
-         . "</table>";
-
+            ("<tr><td>" .  count($temps) . "</td><td>" . _T('info_total') . '</td><td class="time">' . $total . "</td><td></td></tr>")));
+         
        return array($temps, $navigation);
 }