• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed [minor] XenForo_Template_Helper_Core::$helperCallbacks not used for all username calls

Mike Tougeron

Well-known member
#1
[v1.1.0-b2] XenForo_Template_Helper_Core that doesn't always respect the methods defined in XenForo_Template_Helper_Core::$helperCallbacks for username (helperUserName), richusername (helperRichUserName) and usernamehtml (helperUserNameHtml) and instead calls the default methods directly.
 

Mike Tougeron

Well-known member
#2
[mtougeron@localhost:(master) XenForo]$> git diff Template/Helper/Core.php
diff --git a/xenforo/library/XenForo/Template/Helper/Core.php b/xenforo/library/XenForo/Template/Helper/Core.php
index 9b0d45e..c41fd8e 100644
--- a/xenforo/library/XenForo/Template/Helper/Core.php
+++ b/xenforo/library/XenForo/Template/Helper/Core.php
@@ -381,15 +381,15 @@ class XenForo_Template_Helper_Core

if ($users[0])
{
- $user1 = self::helperUserName($users[0]);
+ $user1 = self::callHelper('username', array($users[0]));

if ($users[1])
{
- $user2 = self::helperUserName($users[1]);
+ $user2 = self::callHelper('username', array($users[1]));

if ($users[2])
{
- $user3 = self::helperUserName($users[2]);
+ $user3 = self::callHelper('username', array($users[2]));
}
}
}
@@ -1442,7 +1442,7 @@ class XenForo_Template_Helper_Core

if ($rich)
{
- $username = self::helperRichUserName($user, $username);
+ $username = self::callHelper('richusername', array($user, $username));
}

$href = self::getUserHref($user, $attributes);
@@ -1458,7 +1458,7 @@ class XenForo_Template_Helper_Core

public static function helperUserName(array $user, $class = '', $rich = false)
{
- return self::helperUserNameHtml($user, '', $rich, array('class' => $class));
+ return self::callHelper('usernamehtml', array($user, '', $rich, array('class' => $class)));
}

// -------------------------------------------------