Use Tintin to solve registration urls that end in period, a=chris

Chris Pollett [2016-02-09 17:Feb:th]
Use Tintin to solve registration urls that end in period, a=chris
Filename
src/controllers/RegisterController.php
src/library/Utility.php
diff --git a/src/controllers/RegisterController.php b/src/controllers/RegisterController.php
index 88f337b08..c15e8c65d 100755
--- a/src/controllers/RegisterController.php
+++ b/src/controllers/RegisterController.php
@@ -352,7 +352,8 @@ class RegisterController extends Controller implements CrawlConstants
                 $message .= C\BASE_URL.
                     "?c=register&a=emailVerification&email=".
                     $user['EMAIL']."&time=".$user['CREATION_TIME'].
-                    "&hash=".urlencode(L\crawlCrypt($user['HASH']));
+                    "&hash=".urlencode(L\crawlCrypt($user['HASH'])).
+                    "&tintin=is_cool";
                 $server->send($subject, C\MAIL_SENDER, $data['EMAIL'],
                     $message);
                 if (C\CAPTCHA_MODE == C\TEXT_CAPTCHA) {
@@ -525,10 +526,11 @@ class RegisterController extends Controller implements CrawlConstants
         $message .= tl('register_controller_recover_body')."\n";
         $time = time();
         $message .= C\BASE_URL.
-            "?c=register&a=recoverComplete&user=".
-            $user['USER_NAME']."&time=".$time.
+            "?c=register&a=recoverComplete&user=" .
+            $user['USER_NAME']."&time=" . $time .
             "&hash=".urlencode(L\crawlCrypt(
-                $user['HASH'].$time.$user['USER_NAME'].C\AUTH_KEY));
+                $user['HASH'].$time.$user['USER_NAME'].C\AUTH_KEY)) .
+            "&tintin=is_cool";
         $server->send($subject, C\MAIL_SENDER, $user['EMAIL'], $message);
         unset($_SESSION['CAPTCHA_ANSWERS']);
         unset($_SESSION['CAPTCHA']);
diff --git a/src/library/Utility.php b/src/library/Utility.php
index 66ce88b45..436eccaad 100755
--- a/src/library/Utility.php
+++ b/src/library/Utility.php
@@ -1455,8 +1455,8 @@ function webencode($str)
 {
     $str = base64_encode($str);
     $str = str_replace("/", "_", $str);
-    $str = str_replace("+", ".", $str);
     $str = str_replace("=", "~", $str);
+    $str = str_replace("+", ".", $str);
     return $str;
 }
 /**
@@ -1467,9 +1467,9 @@ function webencode($str)
  */
 function webdecode($str)
 {
-    $str = str_replace("_", "/", $str);
     $str = str_replace(".", "+", $str);
     $str = str_replace("~", "=", $str);
+    $str = str_replace("_", "/", $str);
     return base64_decode($str);
 }
 /**
ViewGit