View Issue Details

IDProjectCategoryView StatusLast Update
0018504phplist applicationMessage Send Processpublic29-01-17 14:19
Reporterduncanc 
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version3.3-RC4 
Target VersionFixed 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
<http://strontian/lists/lt.php?tid=WRTmHjprMgafZuTVd6ROZW7ycgws4TKwlsIFyuT7LRVWLL+Krsw4vJpz91+GZbyL&hm=85a33044395fd647ea03ffea356524ac0c3d4a6fdc9ae10ba4e8927b2e6d8f3c>

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

Activities

duncanc

29-01-17 12:04

developer   ~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.

michiel

29-01-17 12:25

manager   ~0058693

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

duncanc

29-01-17 12:34

developer   ~0058694

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

michiel

29-01-17 12:48

manager   ~0058695

indeed. Good one!

michiel

29-01-17 13:30

manager   ~0058696

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