Fixes display of sql errors.
authorStéphane Jacob <sj@m4x.org>
Sun, 28 Jun 2009 23:11:05 +0000 (01:11 +0200)
committerStéphane Jacob <sj@m4x.org>
Sun, 28 Jun 2009 23:11:05 +0000 (01:11 +0200)
modules/core.php
templates/sql_errors.tpl

index e85241b..92ca70a 100644 (file)
@@ -180,10 +180,9 @@ class CoreModule extends PLModule
     function handler_sqlerror(&$page) {
         global $globals;
         $page->coreTpl('sql_errors.tpl');
-        $file = @fopen($globals->spoolroot . '/spool/tmp/query_errors', 'r');
+        $file = file_get_contents($globals->spoolroot . '/spool/tmp/query_errors');
         if ($file !== false) {
-            $page->assign('errors', fpassthru($file));
-            fclose($file);
+            $page->assign('errors', utf8_encode($file));
         }
         if (Post::has('clear')) {
             @unlink($globals->spoolroot . '/spool/tmp/query_errors');
index d7eb9de..3de70fa 100644 (file)
 {*                                                                        *}\r
 {**************************************************************************}\r
 \r
-<h1>Erreurs MySQL</h2>\r
+<h1>Erreurs MySQL</h1>\r
 <p>\r
   {if $errors}\r
-    {$errors}\r
+    {$errors|smarty:nodefaults}\r
   {else}\r
     Il n'y pas d'erreurs actuellement recencées.\r
   {/if}\r