From 15987f919fa76c6429abecd7daee18e367ccc49a Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 16 Feb 2015 16:24:54 -0800 Subject: [PATCH] Fix *0 secure tripcodes caused by accidentally feeding + signs to crypt() --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index f199372e..69856c3e 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -2228,7 +2228,7 @@ function generate_tripcode($name) { if (isset($config['custom_tripcode']["##{$trip}"])) $trip = $config['custom_tripcode']["##{$trip}"]; else - $trip = '!!' . substr(crypt($trip, '_..A.' . substr(base64_encode(sha1($trip . $config['secure_trip_salt'], true)), 0, 4)), -10); + $trip = '!!' . substr(crypt($trip, str_replace('+', '.', '_..A.' . substr(base64_encode(sha1($trip . $config['secure_trip_salt'], true)), 0, 4))), -10); } else { if (isset($config['custom_tripcode']["#{$trip}"])) $trip = $config['custom_tripcode']["#{$trip}"];