how to fix Broken autolink error?

jessy Master Sergeant
Staff member
Moderating
badge id 32 1000 Resources badge id 109 NullPro Uploader badge id 104 You Are Richer badge id 108 NullPro Lover
Jun 28, 2020
2,789
1,203
$5,518
Broken autolink and error message: TypeError: Argument 1 passed to XF\Util\Url::urlToUtf8() must be of the type string, null given, called in /src/XF/BbCode/ProcessorAction/AutoLink.php on line 430 src/XF/Util/Url.php:50
Code:
XF\Util\Url::urlToUtf8() in src/XF/BbCode/ProcessorAction/AutoLink.php at line 430
XF\BbCode\ProcessorAction\AutoLink->unfurlLinkUrl() in src/XF/BbCode/ProcessorAction/AutoLink.php at line 149
XF\BbCode\ProcessorAction\AutoLink->XF\BbCode\ProcessorAction\{closure}()
preg_replace_callback() in src/XF/BbCode/ProcessorAction/AutoLink.php at line 146
XF\BbCode\ProcessorAction\AutoLink->filterString() in src/XF/BbCode/Processor.php at line 377
XF\BbCode\Processor->filterString() in src/XF/BbCode/Processor.php at line 360
XF\BbCode\Processor->renderString() in src/XF/BbCode/Traverser.php at line 67
XF\BbCode\Traverser->renderSubTree() in src/XF/BbCode/Traverser.php at line 39
XF\BbCode\Traverser->renderAst() in src/XF/BbCode/Traverser.php at line 22
XF\BbCode\Traverser->render() in src/XF/Service/Message/Preparer.php at line 164
XF\Service\Message\Preparer->processMessage() in src/XF/Service/Message/Preparer.php at line 129
XF\Service\Message\Preparer->prepare() in src/addons/XFMG/XF/Service/Message/Preparer.php at line 11
XFMG\XF\Service\Message\Preparer->prepare() in src/XF/Service/Post/Preparer.php at line 98
XF\Service\Post\Preparer->setMessage() in src/XF/Service/Thread/Replier.php at line 114
XF\Service\Thread\Replier->setMessage() in src/XF/Pub/Controller/Thread.php at line 441
XF\Pub\Controller\Thread->setupThreadReply() in src/XF/Pub/Controller/Thread.php at line 590
XF\Pub\Controller\Thread->actionAddReply() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2487
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20

https://4fda00b27df01be5.demo-xenforo.com/2213/index.php?threads/heutzutage-viele-hochhäuser.1/#post-1
Here is the url copied from the forum demo, if we send this link in a message, we will receive a message, as in the screenshot above. Also on the demo forum I inserted a link to the topic in the message, we see an error.
1684261280140.png
1684261458678.png
 
change file about 430 line
xf/BbCode/ProcessorAction/AutoLink.php

defaut
PHP:
if (Url::urlToUtf8($link['url'], false) !== Url::urlToUtf8($link['linkText'], false))
        {
            return false;
        }

to
Code:
        if ($link['url'] !== $link['linkText'])
        {
            return false;
        }
 
Back
Top