diff --git a/docs/NEWS b/docs/NEWS index 0f095e8f..bf331acd 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.5 () ------------------------------------------------------------------------ + * Change mail entry plugin to be able to send mails without + hyperlinks and images. (garvinhicking) + * Change uriArgument parsing routine to allow "!" in URLs. Now we can have absolute serocracy. diff --git a/plugins/serendipity_event_mailer/UTF-8/lang_de.inc.php b/plugins/serendipity_event_mailer/UTF-8/lang_de.inc.php index 78a09af9..2c102066 100644 --- a/plugins/serendipity_event_mailer/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_mailer/UTF-8/lang_de.inc.php @@ -15,3 +15,6 @@ @define('PLUGIN_EVENT_MAILER_SENDING', 'Versende'); @define('PLUGIN_EVENT_MAILER_ISTOSENDIT', 'Diesen Eintrag per E-Mail versenden'); @define('PLUGIN_EVENT_MAILER_SENDTOALL', 'An alle Redakteure schicken'); + +@define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'Bilder und Hyperlinks beibehalten, wenn HTML entfernt wird?'); +@define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Gilt nur, wenn HTML entfernt wird. Falls aktiviert, werden Bilder und Hyperlinks in der Mail enthalten bleiben (in eckigen Klammern). Falls deaktiviert, werden alle Bilder und Hyperlinks auch entfernt.'); diff --git a/plugins/serendipity_event_mailer/lang_de.inc.php b/plugins/serendipity_event_mailer/lang_de.inc.php index 9e342596..66f93350 100644 --- a/plugins/serendipity_event_mailer/lang_de.inc.php +++ b/plugins/serendipity_event_mailer/lang_de.inc.php @@ -15,3 +15,6 @@ @define('PLUGIN_EVENT_MAILER_SENDING', 'Versende'); @define('PLUGIN_EVENT_MAILER_ISTOSENDIT', 'Diesen Eintrag per E-Mail versenden'); @define('PLUGIN_EVENT_MAILER_SENDTOALL', 'An alle Redakteure schicken'); + +@define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'Bilder und Hyperlinks beibehalten, wenn HTML entfernt wird?'); +@define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Gilt nur, wenn HTML entfernt wird. Falls aktiviert, werden Bilder und Hyperlinks in der Mail enthalten bleiben (in eckigen Klammern). Falls deaktiviert, werden alle Bilder und Hyperlinks auch entfernt.'); diff --git a/plugins/serendipity_event_mailer/lang_en.inc.php b/plugins/serendipity_event_mailer/lang_en.inc.php index f1fcced5..6c609ccc 100644 --- a/plugins/serendipity_event_mailer/lang_en.inc.php +++ b/plugins/serendipity_event_mailer/lang_en.inc.php @@ -21,3 +21,5 @@ @define('PLUGIN_EVENT_MAILER_SENDING', 'Sending'); @define('PLUGIN_EVENT_MAILER_ISTOSENDIT', 'Send this entry via E-Mail'); @define('PLUGIN_EVENT_MAILER_SENDTOALL', 'Send to all authors'); +@define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'Keep images and hyperlinks when removing html?'); +@define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Only applies when removing HTML-tags from the mail. If enabled, images and hyperlinks will be put inside the text, when disabled those placeholders will also be removed.'); diff --git a/plugins/serendipity_event_mailer/serendipity_event_mailer.php b/plugins/serendipity_event_mailer/serendipity_event_mailer.php index d128aa05..3e4cf2d9 100644 --- a/plugins/serendipity_event_mailer/serendipity_event_mailer.php +++ b/plugins/serendipity_event_mailer/serendipity_event_mailer.php @@ -26,7 +26,7 @@ class serendipity_event_mailer extends serendipity_event $propbag->add('description', PLUGIN_EVENT_MAILER_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Sebastian Nohn, Kristian Koehntopp, Garvin Hicking'); - $propbag->add('version', '1.51'); + $propbag->add('version', '1.52'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -120,6 +120,13 @@ class serendipity_event_mailer extends serendipity_event $propbag->add('default', 'false'); break; + case 'keepstriptags': + $propbag->add('type', 'boolean'); + $propbag->add('name', PLUGIN_EVENT_MAILER_KEEPSTRIPTAGS); + $propbag->add('description', PLUGIN_EVENT_MAILER_KEEPSTRIPTAGSDESC); + $propbag->add('default', 'true'); + break; + case 'convertp': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EVENT_MAILER_CONVERTP); @@ -249,8 +256,13 @@ class serendipity_event_mailer extends serendipity_event } if (serendipity_db_bool($this->get_config('striptags', false)) == true) { - $mail['body'] = preg_replace('§]+href=["\']([^"\']*)["\'][^>]*>([^<]*)§i', "$2 [$1]", $mail['body']); - $mail['body'] = preg_replace('§]+src=["\']([^"\']*)["\'][^>]*>§i', "[" . IMAGE . ": $1]", $mail['body']); + if (serendipity_db_bool($this->get_config('keepstriptags', true))) { + $mail['body'] = preg_replace('§]+href=["\']([^"\']*)["\'][^>]*>([^<]*)§i', "$2 [$1]", $mail['body']); + $mail['body'] = preg_replace('§]+src=["\']([^"\']*)["\'][^>]*>§i', "[" . IMAGE . ": $1]", $mail['body']); + } else { + $mail['body'] = preg_replace('§]+href=["\']([^"\']*)["\'][^>]*>([^<]*)§i', "", $mail['body']); + $mail['body'] = preg_replace('§]+src=["\']([^"\']*)["\'][^>]*>§i', "", $mail['body']); + } $mail['body'] = strip_tags($mail['body']); }