Markdown Plus PHP error

Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/app/plugins/MarkdownPlus/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 628

Hi All,

Getting the above erroor when I add HTML to the the text boxes with Markdown Plus. Any ideas on how to fix this?

Many thanks <3

Not Reproducible!

Steps To Reproduce

  1. Copy HTML-Source:
<center>Mailing Liste<br>
</center>
<center>
<h1>Digitale Vernetzung "Gemeinwesenarbeit in Braunschweig"</h1>
<h3>πŸ‘¨β€πŸš’πŸ™‹β€β™€οΈπŸ‘±πŸ‘¨πŸ‘¨β€πŸ«πŸ‘¨β€πŸ”§πŸ™†β€β™‚οΈπŸ‘¨β€πŸ”¬πŸ™†πŸ‘©πŸ§“πŸ™†πŸ‘¦πŸ§‘πŸ‘§πŸ§πŸ‘©β€πŸ’ΌπŸ™‹πŸ™‹β€β™‚οΈπŸ‘©β€πŸŽ“πŸ‘©β€πŸŽ¨</h3>
</center>
<center>
<h4>Start fΓΌr eine digitale Vernetzung der vielen
Gemeinwesen-AktivitΓ€ten in BS<br>
</h4>
<br>
  1. Paste into your Task into new lines!
  2. Save Task : As expected corerect view will be shown in Task!

My KANBOARD installation at All-inkl hosting

  • Application version: 1.2.36
  • PHP version: 8.3.8
  • PHP SAPI: fpm-fcgi
  • HTTP Client: cURL
  • OS version: Linux 5.4.0-187-generic
  • Database driver: mysql
  • Database version: 10.5.25-MariaDB-ubu2004-log
  • Browser: FF 130.0a1 (2024-07-31) (64-Bit) on Windows NT 10.0)

Lots of Plugins installed

Broadcast               1.2.36  
Customizer              1.14.2
Group_assign            1.8.2
KanboardSearchPlugin    1.1.0
MarkdownPlus            1.1.4_Master240531
PasteImageToMarkdown    1.1.0
PluginManager           4.7.0
ProjectInvitation       1.0.0
Self-Registration       1.0.8
SubtaskDescription      1.1.3
TagManager              1.6.0
Task2pdf                1.8.0
Wiki                    0.3.2

Also not a problem with MarkdownPlus 1.1.4


@lmfukada / all:
If you want to get help here, you should NOT simply describe your problem! You must describe how other users or developers can reproduce your problem. Including precise information concerning your KANBOARD installation. As I did here in my comment.

CU

Rainer

1 Like

Furthermore, E_DEPRECATED is a warning, not an error. Usually, this class of messaged is disabled in production systems, but maybe not in development.

ini_set(β€˜error_reporting’, E_ALL);

EDIT: BTW, I cannot reproduce it either.

OT: You didn’t upgrade your Wiki?

1 Like

Damned! Updated Wiki-Plugin, but not my notes concerning Installation. Will fix my comment tomorrow!

1 Like

Finally I could enforce it:

Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /home/abu/prj/MarkdownPlus/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 628

As suggested, I replaced line 628:

diff --git a/vendor/erusev/parsedown-extra/ParsedownExtra.php b/vendor/erusev/parsedown-extra/ParsedownExtra.php
index 7a58c39..31b072d 100644
--- a/vendor/erusev/parsedown-extra/ParsedownExtra.php
+++ b/vendor/erusev/parsedown-extra/ParsedownExtra.php
@@ -625,7 +625,7 @@ class ParsedownExtra extends Parsedown
         $DOMDocument = new DOMDocument;
 
         # http://stackoverflow.com/q/11309194/200145
-        $elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');
+        $elementMarkup = htmlentities($elementMarkup, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');
 
         # http://stackoverflow.com/q/4879946/200145
         $success = $DOMDocument->loadHTML($elementMarkup);

The warning disappears.
image

EDIT: I’m not sure if this is really correct.