No Code Attached Yet
avatar Pinkeltje
Pinkeltje
2 Nov 2024

Description

When viewing or editing the COM_ACTIONLOGS_EMAIL_HTMLBODY language constant in the Language Override component, the table structure is completely stripped, leaving only newlines. This prevents administrators from being able to view or modify the email template structure.

Current Behavior

Original language constant:

COM_ACTIONLOGS_EMAIL_HTMLBODY="<h1>Latest User Actions</h1>\n<h2>This is the latest action performed by a user on your website.</h2>\n<table>\n<thead>\n<th>Action</th>\n<th>Date</th>\n<th>Extension</th>\n<th>Name</th>\n</thead>\n<tbody>\n{MESSAGES}<tr>\n<td>{MESSAGE}</td>\n<td>{DATE}</td>\n<td>{EXTENSION}</td>\n<td>{USERNAME}</td>\n</tr>{/MESSAGES}\n</tbody>\n</table>"

What appears in Language Override editor:

<h1>Latest User Actions</h1>\n<h2>This is the latest action performed by a user on your website.</h2>\n\n\n\n\n\n\n\n\n{MESSAGES}\n\n\n\n\n{/MESSAGES}\n\n

The entire table structure including headers and cells is stripped out, leaving only newlines in their place.

Expected Behavior

The Language Override editor should:

  1. Show the complete language string including the table structure
  2. Allow viewing and editing of the original HTML structure
  3. Preserve the email template layout capabilities

Steps to Reproduce

  1. Go to System → Languages → Overrides
  2. Search for COM_ACTIONLOGS_EMAIL_HTMLBODY
  3. Click to edit the constant
  4. Observe that all table-related HTML is missing, replaced with newlines

Technical Details

  • Joomla Version: 5.0
  • Affected Component: Language Overrides
  • Constant: COM_ACTIONLOGS_EMAIL_HTMLBODY

Impact

  1. Administrators cannot see the original email template structure
  2. Unable to make modifications while preserving the table layout
  3. Breaks the ability to customize action log email notifications
  4. Affects core functionality of the User Actions Log feature

Suggested Solutions

  1. Modify the Language Override system to preserve table structures in email-related constants
  2. Add an exception for email template constants
  3. Add a way to mark certain language strings as containing essential HTML that should not be stripped

Additional Context

This appears to be an overly aggressive HTML stripping in the Language Override system. While security is important, stripping HTML from email templates prevents legitimate customization of system emails.
See: #43503

avatar Pinkeltje Pinkeltje - open - 2 Nov 2024
avatar joomla-cms-bot joomla-cms-bot - change - 2 Nov 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Nov 2024
avatar Hackwar
Hackwar - comment - 3 Nov 2024

Thank you @Pinkeltje for reporting this. While the language override system might be very agressive here, it is not meant to edit the email templates. We have the mail template system for this and the language keys are basically just a concession to backwards compatibility. A special handling for email template language key constants is not possible, (already simply by the fact that we don't know what language key is a mail template) but we do indeed have to check if stripping the HTML is correct here.

avatar Pinkeltje
Pinkeltje - comment - 4 Nov 2024

@Hackwar

it is not meant to edit the email templates

As the mailtemplate wasn't working I decided to try with language override. So I really don't know where it goes wrong. But even a simple change in mailtemplate ruins everything.
Original mailtemplate
Image
Small change by changing only second line from <h2> to <p>
Image
Result
Image

Don't know if this info helps, but when I change COM_ACTIONLOGS_EMAIL_HTMLBODY in core language file using <div> in stead of <table> etc, mail is ok-ish (at least all info is preserved), but wrong layout in Outlook.

Add a Comment

Login with GitHub to post a comment