X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fplatal.inc.php;h=ae1a15cf171a3dc483d510309fef82efcf49d598;hb=36f58fcfd9fa0f3660a727effcdc47a6ff4eebf6;hp=bc09f8e503df2e1ef88a566dc16ae8a3f0c49562;hpb=6995a9b92e68cffcf7a8375080f9e5a210acf0af;p=platal.git diff --git a/include/platal.inc.php b/include/platal.inc.php index bc09f8e..ae1a15c 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -1,6 +1,6 @@ "Runtime Notice" ); - $errstr = htmlentities($errstr); + global $globals; + if (isset($globals) && !$globals->debug) { + if (strpos($errortype[$errno], 'Notice') !== false) { + return; + } + } + + $errstr = utf8_encode(htmlentities($errstr)); $GLOBALS['pl_errors'][] = "
". "{$errortype[$errno]} $errstr
". @@ -72,6 +84,16 @@ function pl_error_handler($errno, $errstr, $errfile, $errline) "
"; } +function pl_dump_env() +{ + echo "
";
+    echo "\nSESSION: "; var_export($_SESSION);
+    echo "\nPOST:    "; var_export($_POST);
+    echo "\nGET:     "; var_export($_GET);
+    echo "\nCOOKIE:  "; var_export($_COOKIE);
+    echo "
"; +} + function pl_print_errors() { print join("\n", $GLOBALS['pl_errors']); @@ -79,7 +101,7 @@ function pl_print_errors() set_error_handler('pl_error_handler', E_ALL | E_STRICT); register_shutdown_function('pl_print_errors'); - +// register_shutdown_function('pl_dump_env'); function pl_url($path, $query = null, $fragment = null) { @@ -109,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: ?>