From 7b08f6b5b31bf94e1b707895a9cb043d62faba3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 29 Jun 2009 01:11:05 +0200 Subject: [PATCH] Fixes display of sql errors. --- modules/core.php | 5 ++--- templates/sql_errors.tpl | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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} -- 2.1.4