PHPMailer -> MsgHTML single quote bug
|Reported by:||WPsites||Owned by:|
If you pass in the contents of a HTML email to the MsgHTML method of the PHPMailer class it should attach all images to the email and replace the image src with the path to the attached image. If you use double quotes for the image src everything works fine.
<img src="image.png" />
If however you use single quotes (which as far as I'm aware is still part of the HTML spec for valid attributes) then the function doesn't replace any images or attach any of the images to the email like it's suppose to.
The problem is down to two regular expressions that require double quotes. I have created a diff patch to fix those regular expressions, making both single and double quotes valid.
So now both these work:
<img src="image.png" /> and <img src='image.png' />
I'm not sure what the protocol is regarding patches for external modules but thought I would mention the issue here. I have also sent the diff patch to the developer of the class as specified on Google code so if my patch is worthy (needed even) then the update might get into a future release of PHPMailer.
Change History (6)
- Cc kpayne@… added