summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-01 12:05:07 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-01 12:05:07 +0100
commit76f15c9bb3004e6da99dd273c34ef3b92a23c17f (patch)
treecc8fc0ba56c30b2e29427c89fb49778c67a1f4fa /system/libraries
parent081c946bf049a013aaeab4dc726cdbbe20473eb2 (diff)
Switch ANDs to &&, || to OR in the Email class
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 898effeb6..f1b18ab4f 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -101,7 +101,7 @@ class CI_Email {
}
else
{
- $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
+ $this->_smtp_auth = ! ($this->smtp_user == '' && $this->smtp_pass == '');
$this->_safe_mode = (bool) @ini_get("safe_mode");
}
@@ -136,7 +136,7 @@ class CI_Email {
}
$this->clear();
- $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
+ $this->_smtp_auth = ! ($this->smtp_user == '' && $this->smtp_pass == '');
$this->_safe_mode = (bool) @ini_get("safe_mode");
return $this;
@@ -553,7 +553,7 @@ class CI_Email {
*/
public function set_crlf($crlf = "\n")
{
- $this->crlf = ($crlf !== "\n" AND $crlf !== "\r\n" AND $crlf !== "\r") ? "\n" : $crlf;
+ $this->crlf = ($crlf !== "\n" && $crlf !== "\r\n" && $crlf !== "\r") ? "\n" : $crlf;
return $this;
}
@@ -932,7 +932,7 @@ class CI_Email {
*/
protected function _build_message()
{
- if ($this->wordwrap === TRUE AND $this->mailtype !== 'html')
+ if ($this->wordwrap === TRUE && $this->mailtype !== 'html')
{
$this->_body = $this->word_wrap($this->_body);
}
@@ -1255,9 +1255,9 @@ class CI_Email {
$this->reply_to($this->_headers['From']);
}
- if (( ! isset($this->_recipients) AND ! isset($this->_headers['To'])) AND
- ( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND
- ( ! isset($this->_headers['Cc'])))
+ if ( ! isset($this->_recipients) && ! isset($this->_headers['To'])
+ && ! isset($this->_bcc_array) && ! isset($this->_headers['Bcc'])
+ && ! isset($this->_headers['Cc']))
{
$this->_set_error_message('lang:email_no_recipients');
return FALSE;
@@ -1265,13 +1265,12 @@ class CI_Email {
$this->_build_headers();
- if ($this->bcc_batch_mode AND count($this->_bcc_array) > $this->bcc_batch_size)
+ if ($this->bcc_batch_mode && count($this->_bcc_array) > $this->bcc_batch_size)
{
return $this->batch_bcc_send();
}
$this->_build_message();
-
return $this->_spool_email();
}
@@ -1630,7 +1629,7 @@ class CI_Email {
return TRUE;
}
- if ($this->smtp_user == "" AND $this->smtp_pass == "")
+ if ($this->smtp_user == '' && $this->smtp_pass == '')
{
$this->_set_error_message('lang:email_no_smtp_unpw');
return FALSE;
@@ -1737,13 +1736,13 @@ class CI_Email {
return $this->_IP;
}
- $cip = (isset($_SERVER['HTTP_CLIENT_IP']) AND $_SERVER['HTTP_CLIENT_IP'] != "") ? $_SERVER['HTTP_CLIENT_IP'] : FALSE;
- $rip = (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] != "") ? $_SERVER['REMOTE_ADDR'] : FALSE;
+ $cip = ( ! empty($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : FALSE;
+ $rip = ( ! empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : FALSE;
if ($cip) $this->_IP = $cip;
elseif ($rip) $this->_IP = $rip;
else
{
- $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE;
+ $fip = ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE;
if ($fip)
{
$this->_IP = $fip;
@@ -1800,7 +1799,7 @@ class CI_Email {
$CI =& get_instance();
$CI->lang->load('email');
- if (substr($msg, 0, 5) !== 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5))))
+ if (substr($msg, 0, 5) !== 'lang:' OR FALSE === ($line = $CI->lang->line(substr($msg, 5))))
{
$this->_debug_msg[] = str_replace('%s', $val, $msg)."<br />";
}