View Issue Details

IDProjectCategoryView StatusLast Update
0018504phpList 3 applicationCampaign Send Processpublic29-01-17 14:19
Reporterduncanc Assigned To 
Status resolvedResolutionfixed 
Product Version3.3-RC4 
Fixed in Version3.3.0 
Summary0018504: Links not always converted properly
DescriptionAfter 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, --

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.
TagsNo tags attached.



29-01-17 12:04

updater   ~0058692

Last edited: 29-01-17 12:24

View 2 revisions

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.


29-01-17 12:25

administrator   ~0058693

uuid version 4 always has "-4" in the same place. It can therefore be removed, which is what this line does.


29-01-17 12:34

updater   ~0058694

It is always position 14 so to avoid changing other '-4' sequences should use substr() or similar.


29-01-17 12:48

administrator   ~0058695

indeed. Good one!


29-01-17 13:30

administrator   ~0058696

Moreover, it's replacing -4 with only one character, and that should be 2.