From d8faa4e7e3fb74e554f6c9339f6fe4e2883c3bf1 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 18 Sep 2015 13:43:03 -0400
Subject: [PATCH] Fix by dirkd: Since file() doesn't remove "\n" from the lines read the condition $lines[$l] == '' never evaluated to true. So $mailHeaders would always contain every line from the template while $mailBody contained none of them.
---
interface/web/client/message_template_edit.php | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/interface/web/client/message_template_edit.php b/interface/web/client/message_template_edit.php
index 819e267..7d285ac 100644
--- a/interface/web/client/message_template_edit.php
+++ b/interface/web/client/message_template_edit.php
@@ -56,12 +56,11 @@
// Check for duplicates
if($this->dataRecord['template_type'] == 'welcome') {
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
- $sql = "SELECT count(client_message_template_id) as number FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ".$client_group_id;
+ $sql = "SELECT count(client_message_template_id) as number FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?";
if($this->id > 0) {
- $sql .= " AND client_message_template_id != ".$this->id;
+ $sql .= " AND client_message_template_id != ?";
}
-
- $tmp = $app->db->queryOneRecord($sql);
+ $tmp = $app->db->queryOneRecord($sql, $client_group_id, $this->id);
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng('duplicate_welcome_error');
}
--
Gitblit v1.9.1