Calendar_XH 1.4.6 debugger WARNING

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
Tata
Posts: 3588
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Calendar_XH 1.4.6 debugger WARNING

Post by Tata » Wed May 14, 2014 7:53 pm

WARNING: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback
/Volumes/Localweb/kh4you/plugins/calendar/includes/simplemarkup.php:101
There is the code in this line #101

Code: Select all

$text = preg_replace($pattern, $replacement, $text);
Shall it be corrected?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Calendar_XH 1.4.6 debugger WARNING

Post by cmb » Wed May 14, 2014 8:20 pm

Hm, that's really strange. The code in this line calls preg_replace(), not preg_replace_callback(), so the warning is wrong. However, there is an issue regarding the e modifier in line 85, because this is deprecated and its use is highly discouraged. Furthermore the e modifier works somewhat similar to preg_replace_callback(), so that may cause the warning (IMHO that would be nonetheless wrong).

Anyway, you can try to replace line 85 with:

Code: Select all

        '/\n/'                         //13- transform any remaining line breaks to <br>  
and line 98 with:

Code: Select all

        tag('br')                      //13- replace line breaks by <br>  
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply