tedem / mybb-relator

Another nofollow plugin. By adding `rel="nofollow ugc noopener external"` tag to your outbound links, it informs the bots about the quality of your link and ensures that you don't give backlinks to third-party sites.
https://tedem.dev
MIT License
0 stars 0 forks source link

HTML5 tags error with loadHTML #1

Open firstboy000 opened 1 month ago

firstboy000 commented 1 month ago

Hi, tnx for this plugins ❤️

I used this, and error logs generated this:

<error>
    <dateline>1721216881</dateline>
    <script>inc/plugins/relator.php</script>
    <line>130</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>DOMDocument::loadHTML(): Tag video invalid in Entity, line: 8</message>
    <back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [[PHP]: ]
#2  DOMDocument->loadHTML() called at [/inc/plugins/relator.php:130]
#3  relator_main() called at [/inc/class_plugins.php:142]
#4  pluginSystem->run_hooks() called at [/inc/functions_post.php:898]
#5  build_postbit() called at [/showthread.php:1121]
</back_trace>
</error>

<error>
    <dateline>1721216881</dateline>
    <script>inc/plugins/relator.php</script>
    <line>130</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>DOMDocument::loadHTML(): Tag audio invalid in Entity, line: 17</message>
    <back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [[PHP]: ]
#2  DOMDocument->loadHTML() called at [/inc/plugins/relator.php:130]
#3  relator_main() called at [/inc/class_plugins.php:142]
#4  pluginSystem->run_hooks() called at [/inc/functions_post.php:898]
#5  build_postbit() called at [/showthread.php:1121]
</back_trace>
</error>

We use MyCode to convert mp3 and mp4 links to an player(basic audio or video tag).

for skip that I use LIBXML_NOERROR as option like this(line:130): $dom->loadHTML('<div>' . $contents . '</div>', \LIBXML_HTML_NOIMPLIED | \LIBXML_HTML_NODEFDTD | \LIBXML_NOERROR);

note: LIBXML_NOWARNING has bug on my php version and not worked.

tedem commented 1 month ago

Thank you. I will try to correct it as soon as possible.