Images and paths
Posted: 14 Jan 2020, 11:02
Hello,
I discovered Phoca Email recently, and had a problem with paths. Sometimes relatives path of pictures are not transformed to absolute path.
In your code I saw in phocaemailutils.php the function fixImagesPath () to transform paths.
I understand the problem:
Sometimes my email code is:, and working.
And other times:, and not working.
Your code search for only, so some img tags are ignored if they have style attribute before src.
There are 2 ways to correct it:
The simplest: I just change my html code ! ;-)
For example:
But it can't works because Joomla editor "magically" swap src and style attributes itself ! >:-(
So I change your code from:
to:
Maybe I should use a dom search like in fixLinksPath () function, but it's work ! ;-)
And thanks for Phoco Email, it's a really cool and useful tool !
I discovered Phoca Email recently, and had a problem with paths. Sometimes relatives path of pictures are not transformed to absolute path.
In your code I saw in phocaemailutils.php the function fixImagesPath () to transform paths.
I understand the problem:
Sometimes my email code is:
Code: Select all
<img src="images/logo.jpg" />
And other times:
Code: Select all
<img style="border: 0; height: auto; width: 100%" src="images/logo.jpg" />
Your code search for
Code: Select all
<img src="
There are 2 ways to correct it:
The simplest: I just change my html code ! ;-)
For example:
Code: Select all
<img src="images/logo.jpg" style="border: 0; height: auto; width: 100%" />
So I change your code from:
Code: Select all
return str_replace('<img src="', '<img src="'. JURI::root(), $text);
Code: Select all
return str_replace('src="', 'src="'. JURI::root(), $text);
And thanks for Phoco Email, it's a really cool and useful tool !