View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0018504||phpList 3 application||Message Send Process||public||29-01-17 09:09||29-01-17 14:19|
|Target Version||Fixed in Version||3.3.0|
|Summary||0018504: Links not always converted properly|
|Description||After sending a test message then viewing the text format email one of the links had not been converted properly. This example has two links, the first is correct but the second isn't|
Here is a link
a link to google <%54a33499-78ba-490c-95db-5adb0c8b5c79%%%>
-- powered by phpList, www.phplist.com --
The cause is how the new Uuid class is used. Its methods return an instance of the class, not a string. The class has a __toString() method so that when an instance is used in a string context it is automatically converted to a string.
But there is at least one case of when an instance is used as an array index, which isn't in a string context and is invalid. This seems to happen when a new link has been created rather than using an existing link.
One place to fix this is when the Uuid::generate method is called in function clickTrackLinkId, but it could be done a bit later in the processing
$uuid = (string) Uuid::generate(4);
Other uses of this method should probably be reviewed for the same problem.
|Tags||No tags attached.|
Also, what's the reason for this line when dealing with text links? It seems to make a random change to the concatenation of the uuids. I'm getting a link click failure when the link uuid contains '-4'.
$masked = str_replace('-4', substr(bin2hex(random_bytes(1)), 0, 1), $linkUUID.$cached[$messageid]['uuid'].$userdata['uuid']);
Oh I see now. The third component of a uuid begins with 4. But in this particular uuid the second component also begins with 4.
||uuid version 4 always has "-4" in the same place. It can therefore be removed, which is what this line does.|
||It is always position 14 so to avoid changing other '-4' sequences should use substr() or similar.|
||indeed. Good one!|
||Moreover, it's replacing -4 with only one character, and that should be 2.|