From 345c81a0a6454674bd250286f147b40e2a99102d Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 31 Jan 2014 14:04:55 +0100 Subject: [PATCH 1/2] textile fix compat fix 9eb675b7e4 --- docs/NEWS | 2 ++ .../serendipity_event_textile/serendipity_event_textile.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 1230dbe8..f684cb3d 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,8 @@ Version 1.7.6 () ------------------------------------------------------------------------ + * Fixed textile compat fix + Version 1.7.5 (January 18th, 2014) ------------------------------------------------------------------------ diff --git a/plugins/serendipity_event_textile/serendipity_event_textile.php b/plugins/serendipity_event_textile/serendipity_event_textile.php index 57431e53..01b7a3fa 100644 --- a/plugins/serendipity_event_textile/serendipity_event_textile.php +++ b/plugins/serendipity_event_textile/serendipity_event_textile.php @@ -14,7 +14,7 @@ class serendipity_event_textile extends serendipity_event $propbag->add('description', PLUGIN_EVENT_TEXTILE_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team', 'Lars Strojny'); - $propbag->add('version', '1.8.1'); + $propbag->add('version', '1.8.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -276,10 +276,10 @@ class serendipity_event_textile extends serendipity_event require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Parser.php'; require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/DataBag.php'; require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Tag.php'; - include_once 'textile_namespace.inc.php'; // PHP 5.2 compat + include 'textile_namespace.inc.php'; // PHP 5.2 compat // todo check for user-supplied output to restrict # return $textile->textileRestricted($string); - return $textile->textileThis($string); + if (is_object($textile)) return $textile->textileThis($string); } else { trigger_error(' Textile lib3 needs at least PHP 5.3.0 running. Update your PHP version or use lib2 instead.', E_USER_WARNING); } From dd4b8e09de741bfed1cc6615accf5c3707cefff4 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 3 Feb 2014 15:03:13 +0100 Subject: [PATCH 2/2] Fixed nl2br non-working WYSIWYG treatment and added general markup behaviour INFO notes (Garvin) on how to care by user --- docs/NEWS | 2 ++ .../serendipity_event_nl2br.php | 32 ++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index f684cb3d..3167de3a 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,8 @@ Version 1.7.6 () ------------------------------------------------------------------------ + * Fixed nl2br non-working WYSIWYG treatment and added general markup behaviour notes + * Fixed textile compat fix diff --git a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php index 703564c6..c18d839b 100644 --- a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php +++ b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php @@ -1,6 +1,6 @@ add('description', PLUGIN_EVENT_NL2BR_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team'); - $propbag->add('version', '2.18'); + $propbag->add('version', '2.19'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -85,6 +85,23 @@ class serendipity_event_nl2br extends serendipity_event return true; } + function example() { + echo '

PLEASE NOTE the implications of this markup plugin:

+

This plugin transfers linebreaks to HTML-linebreaks, so that they show up in your blog entry.

+

In two cases this can raise problematic issues for you:

+ +

To prevent problems, you should disable the nl2br plugin on entries globally or per entry within the "Extended properties" section of an entry, if you have the entryproperties plugin installed.

+

Generally advice: The nl2br plugin only makes sense if you

+ '."\n"; + } + function install() { serendipity_plugin_api::hook_event('backend_cache_entries', $this->title); } @@ -204,13 +221,12 @@ class serendipity_event_nl2br extends serendipity_event $serendipity['nl2br']['entry_disabled_markup'] = true; } - // don't add additional br or p tags, if the wysiwyg-editor, the textile, or markdown plugin already took care about markup - if($markup) { - if ( ($serendipity['wysiwyg'] && serendipity_userLoggedIn()) || - ($serendipity['nl2br']['entry_disabled_markup'] === false && (class_exists('serendipity_event_textile') || class_exists('serendipity_event_markdown'))) ) { - return true; - } + // don't run, if the textile, or markdown plugin already took care about markup + if ($markup && $serendipity['nl2br']['entry_disabled_markup'] === false && (class_exists('serendipity_event_textile') || class_exists('serendipity_event_markdown'))) { + return true; } + // NOTE: the wysiwyg-editor needs to send its own ['properties']['ep_no_nl2br'] to disable the nl2br() parser! + // check for users isolation tags if ($isolate === null) { $isolate = $this->get_config('isolate');