NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0018504phplist applicationMessage Send Processpublic29-01-17 09:0929-01-17 14:19
PlatformOSOS Version
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, --

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.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
duncanc (developer)
29-01-17 12:04
edited on: 29-01-17 12:24

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 (manager)
29-01-17 12:25

uuid version 4 always has "-4" in the same place. It can therefore be removed, which is what this line does.
duncanc (developer)
29-01-17 12:34

It is always position 14 so to avoid changing other '-4' sequences should use substr() or similar.
michiel (manager)
29-01-17 12:48

indeed. Good one!
michiel (manager)
29-01-17 13:30

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

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker