Fixed XenForo_Helper_String::getLinkClassTarget errors on relative URLs

Luke F

Well-known member
I think this issue is only triggered by addon code, but regardless a check should be added to ensure if $urlInfo['host'] is empty then it's an internal link.

Code:
Error Info
ErrorException: Undefined index: host - library/XenForo/Helper/String.php:283
Generated By: Unknown Account, Today at 12:42
Stack Trace

#0 /home/nginx/www/gamingmasters.org/library/XenForo/Helper/String.php(283): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/nginx/www...', 283, Array)
#1 /home/nginx/www/gamingmasters.org/library/KingK/BbCodeManager/BbCode/Formatter/Default.php(50): XenForo_Helper_String::getLinkClassTarget('members/the-mc....')
#2 [internal function]: KingK_BbCodeManager_BbCode_Formatter_Default::parseTagUser(Array, Array, Object(EWRutiles_BbCode_Formatter))
#3 /home/nginx/www/gamingmasters.org/library/KingK/BbCodeManager/BbCode/Formatter/Base.php(299): call_user_func_array(Array, Array)
#4 [internal function]: KingK_BbCodeManager_BbCode_Formatter_Base->renderAdvancedTag(Array, Array, Object(EWRutiles_BbCode_Formatter))
#5 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Formatter/Base.php(646): call_user_func(Array, Array, Array, Object(EWRutiles_BbCode_Formatter))
#6 /home/nginx/www/gamingmasters.org/library/KingK/BbCodeManager/BbCode/Formatter/Base.php(515): XenForo_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
#7 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Formatter/Base.php(557): KingK_BbCodeManager_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
#8 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Formatter/Base.php(481): XenForo_BbCode_Formatter_Base->renderTag(Array, Array, 0)
#9 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Formatter/Base.php(462): XenForo_BbCode_Formatter_Base->renderTreeElement(Array, Array, 0)
#10 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Formatter/Base.php(442): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
#11 /home/nginx/www/gamingmasters.org/library/XenForo/BbCode/Parser.php(505): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
#12 /home/nginx/www/gamingmasters.org/library/XenForo/ViewPublic/Forum/View.php(61): XenForo_BbCode_Parser->render('Happy birthday ...')
#13 /home/nginx/www/gamingmasters.org/library/XenForo/ViewRenderer/Abstract.php(220): XenForo_ViewPublic_Forum_View->renderRss()
#14 /home/nginx/www/gamingmasters.org/library/XenForo/ViewRenderer/Rss.php(31): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewPub...', 'Rss', Array, 'forum_view')
#15 /home/nginx/www/gamingmasters.org/library/XenForo/FrontController.php(569): XenForo_ViewRenderer_Rss->renderView('XenForo_ViewPub...', Array, 'forum_view', NULL)
#16 /home/nginx/www/gamingmasters.org/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Rss), Array)
#17 /home/nginx/www/gamingmasters.org/index.php(13): XenForo_FrontController->run()
#18 {main}

Request State

array(3) {
  'url' =>
  string(55) "http://www.gamingmasters.org/forums/random.90/index.rss"
  '_GET' =>
  array(1) {
    '/forums/random_90/index_rss' =>
    string(0) ""
  }
  '_POST' =>
  array(0) {
  }
}
 
This looks like it may be related to BBCM. Does it happen without my add-on enabled? Also, if you are on 1.2 you should delete the BBCM user tag.
 
This looks like it may be related to BBCM. Does it happen without my add-on enabled? Also, if you are on 1.2 you should delete the BBCM user tag.

Ah cheers, have removed that tag now.

The bug is still worth fixing though, even if relative urls never hit the helper function in stock xenforo
 
I should put that note in the actual thread. Didn't think of the incompatibilities it could cause. Although I *think* the tag is fun the same (user=id)
 
Back
Top Bottom