Improve feedback in mod/settings
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 1 Mar 2020 15:15:35 +0000 (10:15 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 1 Mar 2020 15:15:35 +0000 (10:15 -0500)
mod/settings.php

index fcbd820..1d1caa6 100644 (file)
@@ -252,6 +252,8 @@ function settings_post(App $a)
                                unlink($_FILES['importcontact-filename']['tmp_name']);
                        }
                }
+
+               return;
        }
 
        if (!empty($_POST['resend_relocate'])) {
@@ -363,17 +365,17 @@ function settings_post(App $a)
 
        if ($username != $a->user['username']) {
                if (strlen($username) > 40) {
-                       $err .= DI::l10n()->t(' Please use a shorter name.');
+                       $err .= DI::l10n()->t('Please use a shorter name.');
                }
                if (strlen($username) < 3) {
-                       $err .= DI::l10n()->t(' Name too short.');
+                       $err .= DI::l10n()->t('Name too short.');
                }
        }
 
        if ($email != $a->user['email']) {
                //  check for the correct password
                if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
-                       $err .= DI::l10n()->t('Wrong Password') . EOL;
+                       $err .= DI::l10n()->t('Wrong Password.');
                        $email = $a->user['email'];
                }
                //  check the email is valid
@@ -391,7 +393,7 @@ function settings_post(App $a)
        }
 
        if (strlen($err)) {
-               notice($err . EOL);
+               notice($err);
                return;
        }