From b68ba42f9f3a9017b25d7ac6668543c4ccde108c Mon Sep 17 00:00:00 2001 From: Crack Date: Mon, 21 Jun 2010 01:05:45 +0200 Subject: [PATCH] Better error handling --- user_preferences.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/user_preferences.php b/user_preferences.php index 5763ea647..d0a0abeea 100644 --- a/user_preferences.php +++ b/user_preferences.php @@ -67,7 +67,7 @@ foreach ($forms[$form_param] as $form_name => $form) { $form_display->registerForm($form_name, $form); } -if (filter_input(INPUT_GET, 'mode') == 'revert') { +if (isset($_POST['revert'])) { // revert erroneous fields to their default values $form_display->fixErrors(); // redirect @@ -82,19 +82,14 @@ if (!$form_display->process(false)) { } else { // check for form errors if ($form_display->hasErrors()) { - // form has errors, show warning - $separator = PMA_get_arg_separator('html'); + // form has errors ?> -
-

-
- -
- displayErrors() ?> - -   - +
+ + displayErrors(); ?> +
display(true, true); } else { // save settings $result = PMA_save_userprefs();