Duplicate PHP 8.3 warning: Increment on type bool

mqudsi

Member
Affected version
2.2.14-p2
Code:
ErrorException: Template error: [E_WARNING] Increment on type bool has no effect, this will change in the next major version of PHP src/XF/BbCode/Renderer/Html.php:296

Code in question:

PHP:
        if ($rule && !empty($rule['stopSmilies']))
        {
            $options['stopSmilies']++;
        }

I'm not sure why stopSmilies is being treated as a boolean; it's initialized to an integer on line 226 in getDefaultOptions()


Stack trace:

Code:
#0 src/XF/BbCode/Renderer/Html.php(296): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Inc...', 'path/to/file', 296)
#1 src/XF/BbCode/Traverser.php(63): XF\BbCode\Renderer\Html->renderTag(Array, Array)
#2 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#3 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(XF\BbCode\RuleSet), Array)
#4 src/XF/SubContainer/BbCode.php(222): XF\BbCode\Traverser->render('[QUOTE="mqudsi,...', Object(XF\BbCode\Parser), Object(XF\BbCode\RuleSet), Array)
#5 src/XF/Template/Templater.php(2391): XF\SubContainer\BbCode->render('[QUOTE="mqudsi,...', 'emailHtml', 'post', Object(XF\Entity\Post), Array)
#6 src/XF/Template/Templater.php(2411): XF\Template\Templater->fnBbCode(Object(XF\Mail\Templater), false, '[QUOTE="mqudsi,...', 'post', Object(XF\Entity\Post), Array, 'emailHtml')
#7 src/XF/Template/Templater.php(1132): XF\Template\Templater->fnBbCodeType(Object(XF\Mail\Templater), false, 'emailHtml', '[QUOTE="mqudsi,...', 'post', Object(XF\Entity\Post))
#8 /path/to/email/watched_thread_reply.php(18): XF\Template\Templater->func('bb_code_type', Array, false)
#9 src/XF/Template/Templater.php(1655): XF\Template\Templater->{closure}(Object(XF\Mail\Templater), Array, NULL)
#10 src/XF/Mail/Mailer.php(224): XF\Template\Templater->renderTemplate('watched_thread_...', Array)
#11 src/XF/Mail/Mailer.php(158): XF\Mail\Mailer->renderPartialMailTemplate('watched_thread_...', Array, Object(XF\Language), Object(XF\Entity\User))
#12 src/XF/Mail/Mail.php(413): XF\Mail\Mailer->renderMailTemplate('watched_thread_...', Array, Object(XF\Language), Object(XF\Entity\User))
#13 src/XF/Mail/Mail.php(482): XF\Mail\Mail->renderTemplate()
#14 src/XF/Mail/Mail.php(592): XF\Mail\Mail->getSendableMessage()
#15 src/XF/Notifier/Post/AbstractWatch.php(137): XF\Mail\Mail->queue()
#16 src/XF/Service/AbstractNotifier.php(94): XF\Notifier\Post\AbstractWatch->sendEmail(Object(XF\Entity\User))
#17 src/XF/Service/AbstractNotifier.php(46): XF\Service\AbstractNotifier->notifyType(Object(XF\Notifier\Post\ThreadWatch), Array, 1.70683E+9)
#18 src/XF/Service/AbstractNotifier.php(58): XF\Service\AbstractNotifier->notify(3)
#19 src/XF/Service/Thread/Replier.php(252): XF\Service\AbstractNotifier->notifyAndEnqueue(3)
#20 src/XF/Pub/Controller/Thread.php(459): XF\Service\Thread\Replier->sendNotifications()
#21 src/XF/Pub/Controller/Thread.php(618): XF\Pub\Controller\Thread->finalizeThreadReply(Object(XF\Service\Thread\Replier))
#22 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Thread->actionAddReply(Object(XF\Mvc\ParameterBag))
#23 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'AddReply', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Thread), NULL)
#24 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Thread), NULL)
#25 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#26 src/XF/App.php(2508): XF\Mvc\Dispatcher->run()
#27 src/XF.php(524): XF\App->run()
#28 index.php(20): XF::runApp('XF\\Pub\\App')
#29 {main}
 
Fair point -- our messaging here has been confusing recently in some other instances too.

I think we should probably just display different warning messages when below or above the recommended version.
 
Back
Top Bottom