Skip to content

Commit 1c3fff4

Browse files
bramleysuelaP
authored andcommitted
Remove some redundant methods
Simplify use of addCustomHeader() Remove unused parameters from compatSend()
1 parent aa3ddc8 commit 1c3fff4

File tree

2 files changed

+12
-45
lines changed

2 files changed

+12
-45
lines changed

public_html/lists/admin/class.phplistmailer.php

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class phplistMailer extends phplistMailerBase
3030
public function __construct($messageid, $email, $inBlast = true, $exceptions = false)
3131
{
3232
parent::__construct($exceptions);
33-
$this->addCustomHeader('X-phpList-version: '.VERSION);
34-
$this->addCustomHeader("X-MessageID: $messageid");
35-
$this->addCustomHeader("X-ListMember: $email");
33+
$this->addCustomHeader('X-phpList-version', VERSION);
34+
$this->addCustomHeader('X-MessageID', $messageid);
35+
$this->addCustomHeader('X-ListMember', $email);
3636
if (GOOGLE_SENDERID != '') {
37-
$this->addCustomHeader("Feedback-ID: $messageid:".GOOGLE_SENDERID);
37+
$this->addCustomHeader('Feedback-ID', "$messageid:".GOOGLE_SENDERID);
3838
}
3939

4040
//# amazon SES doesn't like this
@@ -56,7 +56,7 @@ public function __construct($messageid, $email, $inBlast = true, $exceptions = f
5656
*/
5757

5858
if (!USE_AMAZONSES && USE_PRECEDENCE_HEADER) {
59-
$this->addCustomHeader('Precedence: bulk');
59+
$this->addCustomHeader('Precedence', 'bulk');
6060
}
6161

6262
$newwrap = getConfig('wordwrap');
@@ -233,10 +233,6 @@ public function append_text($text)
233233
}
234234
}
235235

236-
public function build_message()
237-
{
238-
}
239-
240236
public function CreateHeader()
241237
{
242238
$parentheader = parent::CreateHeader();
@@ -249,32 +245,12 @@ public function CreateHeader()
249245
return $header;
250246
}
251247

252-
public function CreateBody()
253-
{
254-
$body = parent::CreateBody();
255-
/*
256-
if ($this->ContentType != 'text/plain') {
257-
foreach ($GLOBALS['plugins'] as $plugin) {
258-
$plreturn = $plugin->mimeWrap($this->messageid,$body,$this->header,$this->ContentTypeHeader,$this->destinationemail);
259-
if (is_array($plreturn) && sizeof($plreturn) == 3) {
260-
$this->header = $plreturn[0];
261-
$body = $plreturn[1];
262-
$this->ContentTypeHeader = $plreturn[2];
263-
}
264-
}
265-
}
266-
*/
267-
return $body;
268-
}
269-
270248
public function compatSend(
271249
$to_name,
272250
$to_addr,
273251
$from_name,
274252
$from_addr,
275-
$subject = '',
276-
$headers = '',
277-
$envelope = ''
253+
$subject = ''
278254
) {
279255
if (!empty($from_addr) && method_exists($this, 'SetFrom')) {
280256
$this->SetFrom($from_addr, $from_name);
@@ -301,7 +277,7 @@ public function compatSend(
301277
if ($pluginHeaders && count($pluginHeaders)) {
302278
foreach ($pluginHeaders as $headerItem => $headerValue) {
303279
//# @@TODO, do we need to sanitise them?
304-
$this->addCustomHeader($headerItem.': '.$headerValue);
280+
$this->addCustomHeader($headerItem, $headerValue);
305281
}
306282
}
307283
}
@@ -319,15 +295,6 @@ public function compatSend(
319295
return 1;
320296
}
321297

322-
public function Send()
323-
{
324-
if (!parent::Send()) {
325-
return 0;
326-
}
327-
328-
return 1;
329-
}
330-
331298
public function add_attachment($contents, $filename, $mimetype)
332299
{
333300
$this->AddStringAttachment($contents, $filename, 'base64', $mimetype);

public_html/lists/admin/sendemaillib.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,11 @@ function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array()
750750
if ($forwardedby) {
751751
$mail->add_timestamp();
752752
}
753-
$mail->addCustomHeader('List-Help: <'.$text['preferences'].'>');
754-
$mail->addCustomHeader('List-Unsubscribe: <'.$text['jumpoffurl'].'>');
755-
$mail->addCustomHeader('List-Unsubscribe-Post: List-Unsubscribe=One-Click');
756-
$mail->addCustomHeader('List-Subscribe: <'.getConfig('subscribeurl').'>');
757-
$mail->addCustomHeader('List-Owner: <mailto:'.getConfig('admin_address').'>');
753+
$mail->addCustomHeader('List-Help', '<'.$text['preferences'].'>');
754+
$mail->addCustomHeader('List-Unsubscribe', '<'.$text['jumpoffurl'].'>');
755+
$mail->addCustomHeader('List-Unsubscribe-Post', 'List-Unsubscribe=One-Click');
756+
$mail->addCustomHeader('List-Subscribe', '<'.getConfig('subscribeurl').'>');
757+
$mail->addCustomHeader('List-Owner', '<mailto:'.getConfig('admin_address').'>');
758758

759759
list($dummy, $domaincheck) = explode('@', $destinationemail);
760760
$text_domains = explode("\n", trim(getConfig('alwayssendtextto')));

0 commit comments

Comments
 (0)