trim added to new guaranteed users names
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 23 Nov 2015 18:20:06 +0000 (19:20 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 23 Nov 2015 18:20:06 +0000 (19:20 +0100)
TODO.txt
web/index_wr.php

index 86bdddd..156c09c 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -7,7 +7,7 @@
    - Not triple chars between letters
    - 10002 message when already clicked
    - usermgmt: add user delete
-   - trim spaces in apprentice form
+   DONE - trim spaces in apprentice form
    DONE - Remove books from chat
    DONE - usermgmt: add email
 
index b266abb..cb5ed92 100644 (file)
@@ -428,7 +428,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                 if (($wa_lock = Warrant::lock_data(TRUE)) != FALSE) {
                     if (($fp = @fopen(LEGAL_PATH."/warrant.txt", 'a')) != FALSE) {
                         /* Unix time | session | nickname | IP | where was | mesg */
-                        fwrite($fp, sprintf("%ld|%s|%s|%s|\n", $curtime, xcapelt($user->name), xcapelt(urldecode($cli_name)), xcapelt(urldecode($cli_email))));
+                        fwrite($fp, sprintf("%ld|%s|%s|%s|\n", $curtime, xcapelt($user->name), xcapelt(trim(urldecode($cli_name))), xcapelt(trim(urldecode($cli_email)))));
                         fclose($fp);
                     }
                     Warrant::unlock_data($wa_lock);
@@ -450,8 +450,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                     if (($bdb = BriskDB::create()) == FALSE)
                         break;
 
-                    $cli_name = urldecode($cli_name);
-                    $cli_email = urldecode($cli_email);
+                    $cli_name = trim(urldecode($cli_name));
+                    $cli_email = trim(urldecode($cli_email));
 
                     // check for already used fields
                     if (($idret = $bdb->check_record_by_login_or_email($cli_name, $cli_email)) != 0) {