PLEASE NOTE: Since having to deal with a Fatal error Exception thrown:
Uncaught exception 'ErrorException' with message 'Warning: Illegal string offset 'properties'' in /plugins/serendipity_event_nl2br/serendipity_event_nl2br.php:212
Stack trace:
#0 plugins/serendipity_event_nl2br/serendipity_event_nl2br.php(212): errorToExceptionHandler(2, 'Illegal string ...', '/var/www/...', 212, Array)
#1 include/plugin_api.inc.php(1141): serendipity_event_nl2br->event_hook('frontend_displa...', Object(serendipity_property_bag), Array, NULL)
#2 plugins/serendipity_event_guestbook/serendipity_plugin_guestbook.php(196): serendipity_plugin_api::hook_event('frontend_displa...', Array)
#3 include/plugin_api.inc.php(934): serendipity_plugin_guestbook->generate_content('G/xC3/xA4stebuch-Seit...')
changing previous set
!in_array($this->instance, $serendipity['POST']['properties']['disable_markups']) &&
to
!@in_array($this->instance, $serendipity['POST']['properties']['disable_markups']) &&
would give us a wrong result check, since the function !@ is returning false, if 2cd param is not an array, not its value!
See: !@in_array() == FALSE and (isset($serendipity['POST']['properties']['disable_markups']) && !in_array($this->instance, $serendipity['POST']['properties']['disable_markups'])) = TRUE
$serendipity['POST']['properties']['disable_markups'] = array(false); is the only workable solution for (sidebar?) plugins (see sidebar plugins: guestbook, multilingual), to explicitly allow to apply nl2br to markup (if we want to)
Try to auto-detect if site is served via HTTPS or HTTP. The original version requests the captcha via HTTP. So if the site is served via HTTPS, the browser will block this attempt and no captcha will be shown on the site.
It is not a perfect solution (a better one would be to let the user configure it), since it would not detect the correct value if the webserver is behind a proxy (the proxy serves the site via HTTPS and the webserver via HTTP to the proxy). But this solution will work in most of the cases until a serendipity developer can add an extra configuration option.