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

Duplicate XenForo_Controller_Tag::actionTag don't check return result of getTagResultsForDisplay

Xon

Well-known member
#1
XenForo_Model_Tag::getTagResultsForDisplay() can return false, but XenForo_Controller_Tag::actionTag() doesn't check the return result.

This can lead to trying to-do a foreach() on false rather than an array, which fails. This is probably due to a custom tag handler not behaving as expected or having been removed but the custom tags are still in the tag tables.

Example error:
Code:
ErrorException: Invalid argument supplied for foreach() - library/XenForo/ControllerPublic/Tag.php:175
Generated By: Unknown Account, Yesterday at 8:38 AM
Stack Trace
#0 /public_html/library/XenForo/ControllerPublic/Tag.php(175): XenForo_Application::handlePhpError(2, 'Invalid argumen...', '/home/...', 175, Array)
#1 /public_html/library/TagEss/XenForo/ControllerPublic/Tag.php(163): XenForo_ControllerPublic_Tag->actionTag()
#2 /public_html/library/XenForo/FrontController.php(351): TagEss_XenForo_ControllerPublic_Tag->actionTag()
#3 /public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /public_html/index.php(13): XenForo_FrontController->run()
#5 {main}
Request State
array(3) {
["url"] => string(33) "/tags/example/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Note; Tag Essentials just calls XenForo_Controller_Tag::actionTag() as it's first step.