Closed (fixed)
Project:
Swift Mailer (abandoned)
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2018 at 10:55 UTC
Updated:
19 Apr 2020 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
angela_g commentedFaced the same problem on local environment, the provided solution worked for me too.
Comment #3
geek-merlinThanks for this. According to the PHP docs, this can be simplified to rand() without parameters.
Comment #4
crasx commentedAgreed, here is a patch for rand with no parameters.
Comment #5
adamps commentedDocs for rand() says
We don't want duplicate. Maybe even better to use a string? This website shows that possibility. And Random::name() has a $unique parameter.
Please can you patch for the 2.x branch? Hopefully the tests will work then.
Comment #6
geek-merlin> We don't want duplicate. Maybe even better to use a string?
OMG yes you are right. So rand here is not optimal in the first place.
Why not simply use "cid:image-$i"? It just has to be unique in the mail and also is better for debugging.
If not this, Random::name(8,TRUE) will also be better.
Comment #7
adamps commented+1 from me for that.
Comment #8
geek-merlinWell, not quite. Looked deeper into this and the string is a magic token that gets replaced later and should be unique.
Patch flying in with a stab at this that uses your suggestion of Random::name().
Comment #9
adamps commentedThanks, looks good.
Typo "the this"
Comment #11
geek-merlinThanks! Fixed that typo on commit.