New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cid default domain #3036
base: master
Are you sure you want to change the base?
Add cid default domain #3036
Conversation
This is simple, but it opens the door for people setting it to an empty string, something too long, containing spaces, or other invalid value, which would result in invalid cids. I'd suggest either making it protected and using a setter method (that validates it), or validating the value before using it, and if it's invalid, reverting to a fixed (but valid) string. Also, this needs test coverage. |
Another thought: this issue only occurs inside |
I've added some corrections, check them out |
While that's much neater, the default of |
To make it work automatically, maybe let's set $cid_domain to the sender's domain from $this->From ? |
maybe something like that? public function msgHTML($message, $basedir = '', $advanced = false)
{
$cid_domain = '@phpmailer.0';
if (filter_var($this->From, FILTER_VALIDATE_EMAIL)) {
//prepend with a character to create valid RFC822 string in order to validate
$cid_domain = substr( $this->From, strpos( $this->From, '@') + 1);
}
preg_match_all('/(?<!-)(src|background)=["\'](.*)["\']/Ui', $message, $images); |
@Synchro Any comment on this? |
In reference to issue 3031, I have prepared a patch