Completed
Branch master (a49d14)
by Jacob
02:16
created
Archangel.class.php 3 patches
Doc Comments   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @param	string	$address	email address for the recipient
62 62
 	 * @param	string	$title		name of the recipient (optional)
63
-	 * @return	object	instantiated $this
63
+	 * @return	Archangel	instantiated $this
64 64
 	 */
65 65
 	public function addTo($address, $title = '')
66 66
 	{
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @param	string	$address	email address for the cc recipient
77 77
 	 * @param	string	$title		name of the cc recipient (optional)
78
-	 * @return	object	instantiated $this
78
+	 * @return	Archangel	instantiated $this
79 79
 	 */
80 80
 	public function addCC($address, $title = '')
81 81
 	{
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 *
91 91
 	 * @param	string	$address	email address for the bcc recipient
92 92
 	 * @param	string	$title		name of the bcc recipient (optional)
93
-	 * @return	object	instantiated $this
93
+	 * @return	Archangel	instantiated $this
94 94
 	 */
95 95
 	public function addBCC($address, $title = '')
96 96
 	{
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @param	string	$address	email address for the sender
107 107
 	 * @param	string	$title		name of the sender (optional)
108
-	 * @return	object	instantiated $this
108
+	 * @return	Archangel	instantiated $this
109 109
 	 */
110 110
 	public function setFrom($address, $title = '')
111 111
 	{
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 *
121 121
 	 * @param	string	$address	email address for the reply-to
122 122
 	 * @param	string	$title		name of the reply-to (optional)
123
-	 * @return	object	instantiated $this
123
+	 * @return	Archangel	instantiated $this
124 124
 	 */
125 125
 	public function setReplyTo($address, $title = '')
126 126
 	{
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 * Setter method for setting a subject
135 135
 	 *
136 136
 	 * @param	string	$subject	subject for the email
137
-	 * @return	object	instantiated $this
137
+	 * @return	Archangel	instantiated $this
138 138
 	 */
139 139
 	public function setSubject($subject)
140 140
 	{
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * Setter method for the plain text message
149 149
 	 *
150 150
 	 * @param	string	$message	the plain-text message
151
-	 * @return	object	insantiated $this
151
+	 * @return	Archangel	insantiated $this
152 152
 	 */
153 153
 	public function setPlainMessage($message)
154 154
 	{
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * Setter method for the html message
162 162
 	 *
163 163
 	 * @param	string	$message	the html message
164
-	 * @return	object	insantiated $this
164
+	 * @return	Archangel	insantiated $this
165 165
 	 */
166 166
 	public function setHTMLMessage($message)
167 167
 	{
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 * @param	string	$path	the full path of the attachment
177 177
 	 * @param	string	$type	mime type of the file
178 178
 	 * @param	string	$title	the title of the attachment (optional)
179
-	 * @return	object	insantiated $this
179
+	 * @return	Archangel	insantiated $this
180 180
 	 */
181 181
 	public function addAttachment($path, $type, $title = '')
182 182
 	{
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	/**
215 215
 	 * Main instantiator for the class
216 216
 	 *
217
-	 * @return	object	instantiated $this
217
+	 * @return	Archangel	instantiated $this
218 218
 	 */
219 219
 	public static function instance()
220 220
 	{
@@ -400,6 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
 	/**
402 402
 	 * stub for email address checking
403
+	 * @param string $string
403 404
 	 */
404 405
 	private function is_valid_email_address($string)
405 406
 	{
@@ -411,6 +412,7 @@  discard block
 block discarded – undo
411 412
 
412 413
 	/**
413 414
 	 * stub for email title checking
415
+	 * @param string $string
414 416
 	 */
415 417
 	private function is_valid_email_title($string)
416 418
 	{
@@ -419,6 +421,7 @@  discard block
 block discarded – undo
419 421
 
420 422
 	/**
421 423
 	 * stub for subject checking
424
+	 * @param string $string
422 425
 	 */
423 426
 	private function is_valid_subject($string)
424 427
 	{
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function addTo($address, $title = '')
66 66
 	{
67
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
67
+		if ($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
68 68
 			$this->to_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
69 69
 		
70 70
 		return $this;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function addCC($address, $title = '')
81 81
 	{
82
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
82
+		if ($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
83 83
 			$this->cc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
84 84
 		
85 85
 		return $this;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function addBCC($address, $title = '')
96 96
 	{
97
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
97
+		if ($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
98 98
 			$this->bcc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
99 99
 		
100 100
 		return $this;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function setFrom($address, $title = '')
111 111
 	{
112
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
112
+		if ($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
113 113
 			$this->header_array['From'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
114 114
 		
115 115
 		return $this;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 */
125 125
 	public function setReplyTo($address, $title = '')
126 126
 	{
127
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
127
+		if ($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
128 128
 			$this->header_array['Reply-To'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
129 129
 		
130 130
 		return $this;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function setSubject($subject)
140 140
 	{
141
-		if($this->is_valid_subject($subject))
141
+		if ($this->is_valid_subject($subject))
142 142
 			$this->subject = $subject;
143 143
 		
144 144
 		return $this;
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function send()
199 199
 	{
200
-		if($this->passed_validation === FALSE)
200
+		if ($this->passed_validation === FALSE)
201 201
 			return false;
202 202
 		
203
-		if(!$this->check_required_fields())
203
+		if (!$this->check_required_fields())
204 204
 			return false;
205 205
 		
206 206
 		$to = $this->get_to();
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 	{
257 257
 		$message = '';
258 258
 		
259
-		if(isset($this->attachment_array) && count($this->attachment_array) > 0)
259
+		if (isset($this->attachment_array) && count($this->attachment_array) > 0)
260 260
 			$message .= "--{$this->get_boundary()}" . self::$LINE_BREAK;
261 261
 		
262
-		if(
262
+		if (
263 263
 			isset($this->plain_message) && strlen($this->plain_message) > 0 &&
264 264
 			isset($this->html_message) && strlen($this->html_message) > 0)
265 265
 		{
266
-			if(isset($this->attachment_array) && count($this->attachment_array) > 0)
266
+			if (isset($this->attachment_array) && count($this->attachment_array) > 0)
267 267
 			{
268 268
 				$message .= "Content-Type: multipart/alternative; boundary={$this->get_alternative_boundary()}" . self::$LINE_BREAK;
269 269
 				$message .= self::$LINE_BREAK;
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 			$message .= "--{$this->get_alternative_boundary()}--" . self::$LINE_BREAK;
284 284
 			$message .= self::$LINE_BREAK;
285 285
 		}
286
-		else if(isset($this->plain_message) && strlen($this->plain_message))
286
+		else if (isset($this->plain_message) && strlen($this->plain_message))
287 287
 		{
288
-			if(isset($this->attachment_array) && count($this->attachment_array) > 0)
288
+			if (isset($this->attachment_array) && count($this->attachment_array) > 0)
289 289
 			{
290 290
 				$message .= 'Content-Type: text/plain; charset="iso-8859"' . self::$LINE_BREAK;
291 291
 				$message .= 'Content-Transfer-Encoding: 7bit' . self::$LINE_BREAK;
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 			$message .= $this->plain_message;
295 295
 			$message .= self::$LINE_BREAK;
296 296
 		}
297
-		else if(isset($this->html_message) && strlen($this->html_message))
297
+		else if (isset($this->html_message) && strlen($this->html_message))
298 298
 		{
299
-			if(isset($this->attachment_array) && count($this->attachment_array) > 0)
299
+			if (isset($this->attachment_array) && count($this->attachment_array) > 0)
300 300
 			{
301 301
 				$message .= 'Content-Type: text/html; charset="iso-8859-1"' . self::$LINE_BREAK;
302 302
 				$message .= 'Content-Transfer-Encoding: 7bit' . self::$LINE_BREAK;
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 			$message .= $this->html_message;
306 306
 			$message .= self::$LINE_BREAK;
307 307
 		}
308
-		if(isset($this->attachment_array) && count($this->attachment_array) > 0)
308
+		if (isset($this->attachment_array) && count($this->attachment_array) > 0)
309 309
 		{
310
-			foreach($this->attachment_array as $attachment)
310
+			foreach ($this->attachment_array as $attachment)
311 311
 			{
312 312
 				$message .= "--{$this->get_boundary()}" . self::$LINE_BREAK;
313 313
 				$message .= "Content-Type: {$attachment->type}; name=\"{$attachment->title}\"" . self::$LINE_BREAK;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	private $boundary;
332 332
 	private function get_boundary()
333 333
 	{
334
-		if(!isset($this->boundary))
334
+		if (!isset($this->boundary))
335 335
 			$this->boundary = sprintf(self::$BOUNDARY_FORMAT, md5(date('r', time()) . self::$BOUNDARY_SALT));
336 336
 		return $this->boundary;
337 337
 	}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	private $alternative_boundary;
346 346
 	private function get_alternative_boundary()
347 347
 	{
348
-		if(!isset($this->alternative_boundary))
348
+		if (!isset($this->alternative_boundary))
349 349
 			$this->alternative_boundary = sprintf(self::$ALTERNATIVE_BOUNDARY_FORMAT, md5(date('r', time()) . self::$ALTERNATIVE_BOUNDARY_SALT));
350 350
 		return $this->alternative_boundary;
351 351
 	}
@@ -358,25 +358,25 @@  discard block
 block discarded – undo
358 358
 	private function get_additional_headers()
359 359
 	{
360 360
 		$headers = '';
361
-		foreach($this->header_array as $key => $value)
361
+		foreach ($this->header_array as $key => $value)
362 362
 		{
363 363
 			$headers .= "{$key}: {$value}" . self::$LINE_BREAK;
364 364
 		}
365 365
 		
366
-		if(count($this->cc_array) > 0)
366
+		if (count($this->cc_array) > 0)
367 367
 			$headers .= 'CC: ' . implode(', ', $this->cc_array) . self::$LINE_BREAK;
368
-		if(count($this->bcc_array) > 0)
368
+		if (count($this->bcc_array) > 0)
369 369
 			$headers .= 'BCC: ' . implode(', ', $this->bcc_array) . self::$LINE_BREAK;
370 370
 		
371
-		if(isset($this->attachment_array) && count($this->attachment_array) > 0)
371
+		if (isset($this->attachment_array) && count($this->attachment_array) > 0)
372 372
 			$headers .= "Content-Type: multipart/mixed; boundary=\"{$this->get_boundary()}\"";
373
-		else if(
373
+		else if (
374 374
 			isset($this->plain_message) && strlen($this->plain_message) > 0 &&
375 375
 			isset($this->html_message) && strlen($this->html_message) > 0)
376 376
 		{
377 377
 			$headers .= "Content-Type: multipart/alternative; boundary=\"{$this->get_alternative_boundary()}\"";
378 378
 		}
379
-		else if(isset($this->html_message) && strlen($this->html_message) > 0)
379
+		else if (isset($this->html_message) && strlen($this->html_message) > 0)
380 380
 			$headers .= 'Content-type: text/html; charset="iso-8859-1"';
381 381
 		
382 382
 		return $headers;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	private function is_valid_email_address($string)
405 405
 	{
406
-		if(strlen($string) < 1)
406
+		if (strlen($string) < 1)
407 407
 			return $this->fail_validation("{$string} is an invalid email address!");
408 408
 		
409 409
 		return true;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	 */
423 423
 	private function is_valid_subject($string)
424 424
 	{
425
-		if(strlen($string) < 1)
425
+		if (strlen($string) < 1)
426 426
 			return $this->fail_validation("{$string} is an invalid email subject!");
427 427
 		
428 428
 		return true;
Please login to merge, or discard this patch.
Braces   +52 added lines, -39 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function addTo($address, $title = '')
66 66
 	{
67
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
68
-			$this->to_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
67
+		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title)) {
68
+					$this->to_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
69
+		}
69 70
 		
70 71
 		return $this;
71 72
 	}
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 	 */
80 81
 	public function addCC($address, $title = '')
81 82
 	{
82
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
83
-			$this->cc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
83
+		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title)) {
84
+					$this->cc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
85
+		}
84 86
 		
85 87
 		return $this;
86 88
 	}
@@ -94,8 +96,9 @@  discard block
 block discarded – undo
94 96
 	 */
95 97
 	public function addBCC($address, $title = '')
96 98
 	{
97
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
98
-			$this->bcc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
99
+		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title)) {
100
+					$this->bcc_array[] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
101
+		}
99 102
 		
100 103
 		return $this;
101 104
 	}
@@ -109,8 +112,9 @@  discard block
 block discarded – undo
109 112
 	 */
110 113
 	public function setFrom($address, $title = '')
111 114
 	{
112
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
113
-			$this->header_array['From'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
115
+		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title)) {
116
+					$this->header_array['From'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
117
+		}
114 118
 		
115 119
 		return $this;
116 120
 	}
@@ -124,8 +128,9 @@  discard block
 block discarded – undo
124 128
 	 */
125 129
 	public function setReplyTo($address, $title = '')
126 130
 	{
127
-		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title))
128
-			$this->header_array['Reply-To'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
131
+		if($this->is_valid_email_address($address) && $this->is_valid_email_title($title)) {
132
+					$this->header_array['Reply-To'] = ($title != '') ? "\"{$title}\" <{$address}>" : "{$address}";
133
+		}
129 134
 		
130 135
 		return $this;
131 136
 	}
@@ -138,8 +143,9 @@  discard block
 block discarded – undo
138 143
 	 */
139 144
 	public function setSubject($subject)
140 145
 	{
141
-		if($this->is_valid_subject($subject))
142
-			$this->subject = $subject;
146
+		if($this->is_valid_subject($subject)) {
147
+					$this->subject = $subject;
148
+		}
143 149
 		
144 150
 		return $this;
145 151
 	}
@@ -197,11 +203,13 @@  discard block
 block discarded – undo
197 203
 	 */
198 204
 	public function send()
199 205
 	{
200
-		if($this->passed_validation === FALSE)
201
-			return false;
206
+		if($this->passed_validation === FALSE) {
207
+					return false;
208
+		}
202 209
 		
203
-		if(!$this->check_required_fields())
204
-			return false;
210
+		if(!$this->check_required_fields()) {
211
+					return false;
212
+		}
205 213
 		
206 214
 		$to = $this->get_to();
207 215
 		$subject = $this->subject;
@@ -256,8 +264,9 @@  discard block
 block discarded – undo
256 264
 	{
257 265
 		$message = '';
258 266
 		
259
-		if(isset($this->attachment_array) && count($this->attachment_array) > 0)
260
-			$message .= "--{$this->get_boundary()}" . self::$LINE_BREAK;
267
+		if(isset($this->attachment_array) && count($this->attachment_array) > 0) {
268
+					$message .= "--{$this->get_boundary()}" . self::$LINE_BREAK;
269
+		}
261 270
 		
262 271
 		if(
263 272
 			isset($this->plain_message) && strlen($this->plain_message) > 0 &&
@@ -282,8 +291,7 @@  discard block
 block discarded – undo
282 291
 			$message .= self::$LINE_BREAK;
283 292
 			$message .= "--{$this->get_alternative_boundary()}--" . self::$LINE_BREAK;
284 293
 			$message .= self::$LINE_BREAK;
285
-		}
286
-		else if(isset($this->plain_message) && strlen($this->plain_message))
294
+		} else if(isset($this->plain_message) && strlen($this->plain_message))
287 295
 		{
288 296
 			if(isset($this->attachment_array) && count($this->attachment_array) > 0)
289 297
 			{
@@ -293,8 +301,7 @@  discard block
 block discarded – undo
293 301
 			}
294 302
 			$message .= $this->plain_message;
295 303
 			$message .= self::$LINE_BREAK;
296
-		}
297
-		else if(isset($this->html_message) && strlen($this->html_message))
304
+		} else if(isset($this->html_message) && strlen($this->html_message))
298 305
 		{
299 306
 			if(isset($this->attachment_array) && count($this->attachment_array) > 0)
300 307
 			{
@@ -331,8 +338,9 @@  discard block
 block discarded – undo
331 338
 	private $boundary;
332 339
 	private function get_boundary()
333 340
 	{
334
-		if(!isset($this->boundary))
335
-			$this->boundary = sprintf(self::$BOUNDARY_FORMAT, md5(date('r', time()) . self::$BOUNDARY_SALT));
341
+		if(!isset($this->boundary)) {
342
+					$this->boundary = sprintf(self::$BOUNDARY_FORMAT, md5(date('r', time()) . self::$BOUNDARY_SALT));
343
+		}
336 344
 		return $this->boundary;
337 345
 	}
338 346
 
@@ -345,8 +353,9 @@  discard block
 block discarded – undo
345 353
 	private $alternative_boundary;
346 354
 	private function get_alternative_boundary()
347 355
 	{
348
-		if(!isset($this->alternative_boundary))
349
-			$this->alternative_boundary = sprintf(self::$ALTERNATIVE_BOUNDARY_FORMAT, md5(date('r', time()) . self::$ALTERNATIVE_BOUNDARY_SALT));
356
+		if(!isset($this->alternative_boundary)) {
357
+					$this->alternative_boundary = sprintf(self::$ALTERNATIVE_BOUNDARY_FORMAT, md5(date('r', time()) . self::$ALTERNATIVE_BOUNDARY_SALT));
358
+		}
350 359
 		return $this->alternative_boundary;
351 360
 	}
352 361
 
@@ -363,21 +372,23 @@  discard block
 block discarded – undo
363 372
 			$headers .= "{$key}: {$value}" . self::$LINE_BREAK;
364 373
 		}
365 374
 		
366
-		if(count($this->cc_array) > 0)
367
-			$headers .= 'CC: ' . implode(', ', $this->cc_array) . self::$LINE_BREAK;
368
-		if(count($this->bcc_array) > 0)
369
-			$headers .= 'BCC: ' . implode(', ', $this->bcc_array) . self::$LINE_BREAK;
375
+		if(count($this->cc_array) > 0) {
376
+					$headers .= 'CC: ' . implode(', ', $this->cc_array) . self::$LINE_BREAK;
377
+		}
378
+		if(count($this->bcc_array) > 0) {
379
+					$headers .= 'BCC: ' . implode(', ', $this->bcc_array) . self::$LINE_BREAK;
380
+		}
370 381
 		
371
-		if(isset($this->attachment_array) && count($this->attachment_array) > 0)
372
-			$headers .= "Content-Type: multipart/mixed; boundary=\"{$this->get_boundary()}\"";
373
-		else if(
382
+		if(isset($this->attachment_array) && count($this->attachment_array) > 0) {
383
+					$headers .= "Content-Type: multipart/mixed; boundary=\"{$this->get_boundary()}\"";
384
+		} else if(
374 385
 			isset($this->plain_message) && strlen($this->plain_message) > 0 &&
375 386
 			isset($this->html_message) && strlen($this->html_message) > 0)
376 387
 		{
377 388
 			$headers .= "Content-Type: multipart/alternative; boundary=\"{$this->get_alternative_boundary()}\"";
389
+		} else if(isset($this->html_message) && strlen($this->html_message) > 0) {
390
+					$headers .= 'Content-type: text/html; charset="iso-8859-1"';
378 391
 		}
379
-		else if(isset($this->html_message) && strlen($this->html_message) > 0)
380
-			$headers .= 'Content-type: text/html; charset="iso-8859-1"';
381 392
 		
382 393
 		return $headers;
383 394
 	}
@@ -403,8 +414,9 @@  discard block
 block discarded – undo
403 414
 	 */
404 415
 	private function is_valid_email_address($string)
405 416
 	{
406
-		if(strlen($string) < 1)
407
-			return $this->fail_validation("{$string} is an invalid email address!");
417
+		if(strlen($string) < 1) {
418
+					return $this->fail_validation("{$string} is an invalid email address!");
419
+		}
408 420
 		
409 421
 		return true;
410 422
 	}
@@ -422,8 +434,9 @@  discard block
 block discarded – undo
422 434
 	 */
423 435
 	private function is_valid_subject($string)
424 436
 	{
425
-		if(strlen($string) < 1)
426
-			return $this->fail_validation("{$string} is an invalid email subject!");
437
+		if(strlen($string) < 1) {
438
+					return $this->fail_validation("{$string} is an invalid email subject!");
439
+		}
427 440
 		
428 441
 		return true;
429 442
 	}
Please login to merge, or discard this patch.