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

Fix: Preserve Redirection Links for Images in Emails #18397

Open
wants to merge 2 commits into
base: 10.0/bugfixes
Choose a base branch
from

Conversation

MyvTsv
Copy link
Contributor

@MyvTsv MyvTsv commented Nov 27, 2024

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

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.

@MyvTsv MyvTsv marked this pull request as ready for review November 28, 2024 10:25
@MyvTsv MyvTsv requested a review from Rom1-B November 28, 2024 10:25
@stonebuzz
Copy link
Contributor

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 <img>, including HTML tags.

<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>

@trasher
Copy link
Contributor

trasher commented Nov 28, 2024

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?

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

Successfully merging this pull request may close these issues.

3 participants