X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fplatal.inc.php;h=ae1a15cf171a3dc483d510309fef82efcf49d598;hb=493b6abebf3d6c35691f66fd1bfdc063efaab576;hp=1d8d6b7b82f889515a0b74048d84869c789945fc;hpb=28023828aec24a8a8dc08787b6223e8fef2f4909;p=platal.git diff --git a/include/platal.inc.php b/include/platal.inc.php index 1d8d6b7..ae1a15c 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -1,6 +1,6 @@ debug) { + if (isset($globals) && !$globals->debug) { if (strpos($errortype[$errno], 'Notice') !== false) { return; } } - $errstr = htmlentities($errstr); + $errstr = utf8_encode(htmlentities($errstr)); $GLOBALS['pl_errors'][] = "
". "{$errortype[$errno]} $errstr
". @@ -131,5 +131,15 @@ function pl_redirect($path, $query = null, $fragment = null) http_redirect($globals->baseurl . '/' . pl_url($path, $query, $fragment)); } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +function pl_entities($text, $mode = ENT_COMPAT) +{ + return htmlentities($text, $mode, 'UTF-8'); +} + +function pl_entity_decode($text, $mode = ENT_COMPAT) +{ + return html_entity_decode($text, $mode, 'UTF-8'); +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>