Browse Source

Fix *0 secure tripcodes caused by accidentally feeding + signs to crypt()

pull/40/head
8chan 9 years ago
committed by czaks
parent
commit
ce3ce4f1b6
  1. 2
      inc/functions.php

2
inc/functions.php

@ -2374,7 +2374,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}"];

Loading…
Cancel
Save