-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix: Preserve Redirection Links for Images in Emails #18397
base: 10.0/bugfixes
Are you sure you want to change the base?
Conversation
Maybe a new test should be added (instead of update it) to test the regex format (permissive now) To test that it accepts any type of content before or after <a href="example.com">
<span>Balise imbriquée</span>
<img src="image.jpg" alt="Image" class="tag-class" />
</a> <a href="example.com">
Une image simple
<img src="image.jpg" alt="Image" class="tag-class" />
Plus de texte ici
</a> <a href="example.com">
<div>
Contenu complexe
<img src="image.jpg" class="tag-class" />
</div>
</a> |
I'm not sure I understand this fix... It talks about keeping redireciton link, and tests was adapted to drop one :D Also, it seems the previous fix was successfully used by the customer; is this the same case as the "original" one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous test case should be preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other format should be test too
@@ -943,7 +943,7 @@ public function testConvertTagToImageAlreadyInLink() | |||
$expected_result = <<<HTML | |||
Some contents with <a href="http://example.org/">a link</a> | |||
and a first image <a href="{$expected_url_1}" target="_blank"><img alt="{$img_1_tag}" width="10" src="{$image_1_src}" /></a> inside a link | |||
then a second image surrounded by links <a href="http://www.example.org/">link1</a> <a href="{$image_2_src}" target="_blank" ><img alt="{$img_2_tag}" width="10" src="{$image_2_src}" /></a> <a href="http://www.example.org/2">link2</a> | |||
then a second image surrounded by links <a href="http://www.example.org/">link1</a> <img alt="{$img_2_tag}" width="10" src="{$image_2_src}" /> <a href="http://www.example.org/2">link2</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then a second image surrounded by links <a href="http://www.example.org/">link1</a> <img alt="{$img_2_tag}" width="10" src="{$image_2_src}" /> <a href="http://www.example.org/2">link2</a> | |
then a second image surrounded by links <a href="http://www.example.org/">link1</a> <a href="{$image_2_src}" target="_blank" ><img alt="{$img_2_tag}" width="10" src="{$image_2_src}" /></a> <a href="http://www.example.org/2">link2</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep original test
Description
It fixes !35308
This PR fixes an issue where the redirect link associated with an image sent via the GLPI collector was removed. When someone sent an image with a redirect link, the link was deleted, preventing the redirect from working. Therefore, in a ticket when t-one clicked on the image, GLPI redirected us to it and not to the URL that was associated with it.