- Posts: 89
- Thank you received: 13
Kunena 7.0.9 & Kunena 6.4.14 – Security Updates Released
The Kunena team has announce the arrival of Kunena 7.0.9 [K 7.0.9] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x./6.1.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
Question Deleted Joomla users cause rendering error in profileIcon('email')
2 days 22 hours ago #235333
by guidocx84
Hello,I have identified what appears to be a bug in Kunena 6.4.14 when a forum post belongs to a user who has subsequently been deleted from Joomla.Environment
, while their historical posts are still present in
.The important detail is that the problem only occurs when the topic is viewed by a Super User (or another user who is allowed to see registered users' email addresses). Normal users can view the same topic without any problem.The actual errorThe rendering error is:
, inside
:
For a deleted Joomla user,
is
.Therefore:
causes a PHP
, because
requires a string:
The PHP error interrupts the rendering of the profile layout. As a consequence, the surrounding HTML is not completed correctly, and all subsequent posts can appear to be nested inside the affected post's
.This initially looked like a template/layout problem, but it is actually a consequence of the PHP rendering error.Temporary workaroundI tested the following change in
:
After this change, the affected topics render correctly again.The deleted user's post remains visible, but the email icon is simply omitted, which seems appropriate because the Joomla user and therefore the email address no longer exist.QuestionCould this be addressed in Kunena 6.4.x itself?It seems that
should handle a
email when a Kunena user record remains after the corresponding Joomla user has been deleted.I would also appreciate advice on the recommended way to implement this as an override or extension, rather than modifying
directly, since a core modification would presumably be overwritten by a future Kunena update.Thank you!
- Joomla: 5.4.8
- Kunena: 6.4.14
- PHP: 8.3
Code:
#__kunena_users
Code:
#__kunena_messages
The error points toRendering Error in layout User/Profile:
Code:Kunena\Forum\Libraries\User\KunenaUser::escape(): Argument #1 ($var) must be of type string, null given
Code:
KunenaUser.php
Code:
profileIcon()
Code:
case 'email':
return '[email]' . $this->email . '[/email]';
break;
Code:
$this->email
Code:
NULL
Code:
$this->escape($this->email)
Code:
TypeError
Code:
escape()
Code:
public function escape(string $var): string
{
return htmlspecialchars($var, ENT_COMPAT, 'UTF-8');
}
Code:
div.row.message
Code:
KunenaUser.php
Code:
case 'email':
if (!$this->email) {
return false;
}
return '<a href="mailto:' . $this->email . '" data-bs-toggle="tooltip" data-placement="right" title="' . $this->escape($this->email) . '">' . KunenaIcons::email() . '</a>';
break;
After this change, the affected topics render correctly again.The deleted user's post remains visible, but the email icon is simply omitted, which seems appropriate because the Joomla user and therefore the email address no longer exist.QuestionCould this be addressed in Kunena 6.4.x itself?It seems that
Code:
profileIcon('email')
Code:
NULL
Code:
libraries/kunena/src/User/KunenaUser.php
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 1013
- Thank you received: 161
2 days 22 hours ago #235334
by Pinkeltje
Replied by Pinkeltje on topic Deleted Joomla users cause rendering error in profileIcon('email')
This has been fixed in Kunena 7. Kunena 6 only receives security updates so you should update to Kunena 7.
Please Log in or Create an account to join the conversation.
2 days 22 hours ago #235335
by guidocx84
Replied by guidocx84 on topic Deleted Joomla users cause rendering error in profileIcon('email')
I'm not planning to update Kunena soon, so I would also appreciate advice on the recommended way to implement this as an override or extension, rather than modifying the impacted file directly, since a core modification would presumably be overwritten by a future Kunena 6.4.x security update. Thank you!This has been fixed in Kunena 7. Kunena 6 only receives security updates so you should update to Kunena 7.
Please Log in or Create an account to join the conversation.
Time to create page: 0.249 seconds