Skip to content
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

Embed file are not catched #97

Open
impnet opened this issue Jan 18, 2024 · 0 comments
Open

Embed file are not catched #97

impnet opened this issue Jan 18, 2024 · 0 comments

Comments

@impnet
Copy link

impnet commented Jan 18, 2024

Version: 3.1

Bug Description

Embed files (images) <img src=".....> are not matched/replaced correctly in Message::setHtmlBody().

Steps To Reproduce

$html = '<img src="C:\Users\FRANTA\projects\Project-X\temp\content\con33C8.svg">';
Message::setHtmlBody($html, '');

will produce:

<img src="C:\Users\FRANTA\projects\Project-X\temp\content\con33C8.svg">

instead of

<img src="cid:xyyrj49su6@localhost">

Expected Behavior

<img src="C:\Users\FRANTA\projects\Project-X\temp\content\con33C8.svg"> converted to <img src="cid:xyyrj49su6@localhost">

Possible Solution

Modify regex in Message::setHtmlBody()
Patter <img[^<>]*\s src\s*=\s* will not catch path contains colons : or spaces .

For images in different folders i can not use param $basePath
Example of used images in html body:
C:\Users\FRANTA\projects\Project-X\temp\content\con33C8.svg
C:\Users\FRANTA\projects\Project-X\app\some folders with spaces\xxxx.jpg
./another folder in root/sub folder/yyyy.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant