New SMS screen crashes due to extra space in {htxt id ="id-sms_..."} in Group.hlp
Overview
After updating from Civi 5.57.x to 5.61.2, pressing "New SMS" or navigating to /civicrm/sms/send?reset=1 results in this error message:
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
Invalid {htxt} tag. Wrapped 10 opening-tags and 12 closing-tags.
Reproduction steps
- Navigate to /civicrm/sms/send?reset=1
Current behaviour
Some of the page content is present, but most of it is replaced with the error message mentioned above.
Expected behaviour
It should have a form for selecting the SMS provider, as well as "Next" and "Cancel" buttons.
Environment information
- CiviCRM: 5.61.2
Comments
The bug is caused by the extra spaces in the last two {htxt} tags in this file:
https://lab.civicrm.org/dev/core/-/blob/master/templates/CRM/SMS/Form/Group.hlp#L50-53
This regex doesn't match the extra space, so it throws an exception when the count of {htxt}
s doesn't match the count of {/htxt}
s:
https://lab.civicrm.org/dev/core/-/blob/master/CRM/Core/Smarty/plugins/prefilter.htxtFilter.php#L21
Removing the extra spaces fixes the page:
{htxt id="id-sms_provider-title"}
and
{htxt id="id-sms_provider"}