From: Stéphane Jacob Date: Sun, 28 Jun 2009 23:11:05 +0000 (+0200) Subject: Fixes display of sql errors. X-Git-Tag: core/1.0.1~9 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7b08f6b5b31bf94e1b707895a9cb043d62faba3e;p=platal.git Fixes display of sql errors. --- diff --git a/modules/core.php b/modules/core.php index e85241b..92ca70a 100644 --- a/modules/core.php +++ b/modules/core.php @@ -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'); diff --git a/templates/sql_errors.tpl b/templates/sql_errors.tpl index d7eb9de..3de70fa 100644 --- a/templates/sql_errors.tpl +++ b/templates/sql_errors.tpl @@ -20,10 +20,10 @@ {* *} {**************************************************************************} -

Erreurs MySQL

+

Erreurs MySQL

{if $errors} - {$errors} + {$errors|smarty:nodefaults} {else} Il n'y pas d'erreurs actuellement recencées. {/if}