Skip to content

Commit a139f35

Browse files
committed
#142 - update link creation
1 parent 0067c3e commit a139f35

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

public_html/lists/admin/sendemaillib.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,11 @@ function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array()
627627
$masked = preg_replace('/=$/', '', $masked);
628628
$masked = urlencode($masked);
629629
} else {
630-
$masked = substr($linkUUID,0,14).bin2hex(random_bytes(1)).substr($linkUUID,15).
631-
substr($cached[$messageid]['uuid'],0,14).bin2hex(random_bytes(1)).substr($cached[$messageid]['uuid'],15).
632-
substr($userdata['uuid'],0,14).bin2hex(random_bytes(1)).substr($userdata['uuid'],15);
630+
$masked = $linkUUID . $cached[$messageid]['uuid'] . $userdata['uuid'];
631+
$uuidLength = strlen($linkUUID);
632+
$masked[14] = substr(bin2hex(random_bytes(1)), 0, 1);
633+
$masked[$uuidLength + 14] = substr(bin2hex(random_bytes(1)), 0, 1);
634+
$masked[$uuidLength * 2 + 14] = substr(bin2hex(random_bytes(1)), 0, 1);
633635
$masked = str_replace('=', '', base64_encode(hex2bin(str_replace('-', '', $masked))));
634636
}
635637
if (SIGN_WITH_HMAC) {

0 commit comments

Comments
 (0)