Skip to content

Commit ed7dd4b

Browse files
committed
changed the preg_split to explode per fox. fixed the template to
have a block for note and only include if there is a note
1 parent 7aab561 commit ed7dd4b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

plugins/mail/init.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ function emailArticle() {
7070
$subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]);
7171

7272
$tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
73+
$tnote = strip_tags($line["note"]);
74+
if( $tnote != ''){
75+
$tpl->setVariable('ARTICLE_NOTE', $tnote, true);
76+
$tpl->addBlock('note');
77+
}
7378
$tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
74-
$tpl->setVariable('ARTICLE_NOTE', strip_tags($line["note"]));
7579

7680
$tpl->addBlock('article');
7781
}
@@ -138,7 +142,7 @@ function sendEmail() {
138142
$mail->From = strip_tags($_REQUEST['from_email']);
139143
$mail->FromName = strip_tags($_REQUEST['from_name']);
140144
//$mail->AddAddress($_REQUEST['destination']);
141-
$addresses = preg_split('/;/', $_REQUEST['destination'],-1,PREG_SPLIT_NO_EMPTY);
145+
$addresses = explode(';', $_REQUEST['destination']);
142146
foreach($addresses as $nextaddr)
143147
$mail->AddAddress($nextaddr);
144148

templates/email_article_template.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Thought I'd share the following with you:
55

66
<!-- $BeginBlock article -->
77
* ${ARTICLE_TITLE}
8-
8+
<!-- $BeginBlock note -->
99
${ARTICLE_NOTE}
10-
10+
<!-- $EndBlock note -->
1111
${ARTICLE_URL}
1212
<!-- $EndBlock article -->
1313

0 commit comments

Comments
 (0)