selfthinker / dokuwiki_plugin_wrap

Wrap Plugin for DokuWiki: Universal plugin which combines functionalities of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction.
http://www.dokuwiki.org/plugin:wrap
GNU General Public License v2.0
41 stars 33 forks source link

Fix "Empty regular expression" PHP8 Warning #257

Closed eduardomozart closed 1 year ago

eduardomozart commented 1 year ago

Hello, When using ODT plugin to export a DokuWiki page (in attachment) with display_errors PHP8 directive set as ON, the following error was being thrown:

Warning: preg_match(): Empty regular expression in /home/eduardo/public_html/wiki/lib/plugins/wrap/helper.php on line 87

This PR ensures that $noPrefix isn't empty (because it can be, as can be seen here: https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/master/helper.php#L49) before using it as a RegEx pattern.

Here's my noPrefix Wrap config (not seems to be related with this issue): tabs, group,admonition,danger,caution,note

cnh.txt