? bug ? PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar ManuelHu
ManuelHu
5 Mar 2023

Pull Request for Issue (no issue). Found while doing code review.

Summary of Changes

Currently, the array keys passed to MailTemplate::replaceTags() are directly used within the regular expression. This is prone to errors, if ever some array keys are used that contain special characters (e.g. +, *, ...).

Quoting the key should prevent some possible (future) weird behaviour, if an array key contains a regex control character. This should not create any b/c problems, as afaik no keys with special characters are currently defined/used. Also, regular expression control chars could not be used in a sensible way in this place anyways.

Testing Instructions

  • enable action log emails for the user component (in the settings of yxour personal account)
  • perform some actions, e.g. loggin out and back again
  • look at the sent emails

Actual result BEFORE applying this Pull Request

it works (the email contains information and no placeholders)

Expected result AFTER applying this Pull Request

it still works (no visble change to above)

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2023
Category Libraries
avatar ManuelHu ManuelHu - open - 5 Mar 2023
avatar ManuelHu ManuelHu - change - 5 Mar 2023
Status New Pending
avatar toivo toivo - test_item - 20 Mar 2023 - Tested successfully
avatar toivo
toivo - comment - 20 Mar 2023

I have tested this item successfully on 91c2096

Tested successfully in Joomla 4.2.10-dev of 19 March using PHP 8.1.10


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40032.

avatar viocassel viocassel - test_item - 21 Mar 2023 - Tested successfully
avatar viocassel
viocassel - comment - 21 Mar 2023

I have tested this item successfully on 91c2096


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40032.

avatar richard67 richard67 - change - 21 Mar 2023
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 21 Mar 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40032.

avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 4.3-dev.

avatar obuisard obuisard - change - 5 May 2023
Labels Added: ? bug
avatar obuisard obuisard - change - 5 May 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-05-05 17:33:36
Closed_By obuisard
Labels Added: PR-4.3-dev
avatar obuisard obuisard - close - 5 May 2023
avatar obuisard obuisard - merge - 5 May 2023
avatar obuisard
obuisard - comment - 5 May 2023

Thank you @ManuelHu for the PR!

Add a Comment

Login with GitHub to post a comment