Skip to content
Snippets Groups Projects
Commit 33be5e1e authored by Peter Rotich's avatar Peter Rotich
Browse files

lint: Lint test fixes

parent 2f71c968
Branches
Tags
No related merge requests found
...@@ -200,10 +200,10 @@ class Email { ...@@ -200,10 +200,10 @@ class Email {
function getIdByEmail($email) { function getIdByEmail($email) {
$sql='SELECT email_id FROM '.EMAIL_TABLE.' WHERE email='.db_input($email); $sql='SELECT email_id FROM '.EMAIL_TABLE.' WHERE email='.db_input($email);
if(($res=db_query($sql)) && db_num_rows($res)) if(!($res=db_query($sql)) || !db_num_rows($res))
list($id)=db_fetch_row($res); return false;
return $id; return db_result($res);
} }
function lookup($var) { function lookup($var) {
......
...@@ -94,19 +94,21 @@ class Mail_Parse { ...@@ -94,19 +94,21 @@ class Mail_Parse {
} }
// Look for application/tnef attachment and process it // Look for application/tnef attachment and process it
foreach ($this->struct->parts as $i=>$part) { if ($this->struct && $this->struct->parts) {
if (!$part->parts && $part->ctype_primary == 'application' foreach ($this->struct->parts as $i=>$part) {
&& $part->ctype_secondary == 'ms-tnef') { if (!@$part->parts && $part->ctype_primary == 'application'
try { && $part->ctype_secondary == 'ms-tnef') {
$tnef = new TnefStreamParser($part->body); try {
$this->tnef = $tnef->getMessage(); $tnef = new TnefStreamParser($part->body);
// No longer considered an attachment $this->tnef = $tnef->getMessage();
unset($this->struct->parts[$i]); // No longer considered an attachment
} unset($this->struct->parts[$i]);
catch (TnefException $ex) { }
// TNEF will remain an attachment catch (TnefException $ex) {
$this->notes[] = 'TNEF parsing exception: ' // TNEF will remain an attachment
.$ex->getMessage(); $this->notes[] = 'TNEF parsing exception: '
.$ex->getMessage();
}
} }
} }
} }
...@@ -489,6 +491,12 @@ class EmailDataParser { ...@@ -489,6 +491,12 @@ class EmailDataParser {
return $this->err('Email parse failed ['.$parser->getError().']'); return $this->err('Email parse failed ['.$parser->getError().']');
$data =array(); $data =array();
$data['emailId'] = 0;
$data['subject'] = $parser->getSubject();
$data['header'] = $parser->getHeader();
$data['mid'] = $parser->getMessageId();
$data['priorityId'] = $parser->getPriority();
//FROM address: who sent the email. //FROM address: who sent the email.
if(($fromlist = $parser->getFromAddressList())) { if(($fromlist = $parser->getFromAddressList())) {
$from=$fromlist[0]; //Default. $from=$fromlist[0]; //Default.
...@@ -542,10 +550,6 @@ class EmailDataParser { ...@@ -542,10 +550,6 @@ class EmailDataParser {
$data['flags']['bounce'] = TicketFilter::isBounce($data['header']); $data['flags']['bounce'] = TicketFilter::isBounce($data['header']);
} }
$data['subject'] = $parser->getSubject();
$data['header'] = $parser->getHeader();
$data['mid'] = $parser->getMessageId();
$data['priorityId'] = $parser->getPriority();
$data['emailId'] = $emailId; $data['emailId'] = $emailId;
if (($replyto = $parser->getReplyTo())) { if (($replyto = $parser->getReplyTo())) {
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -22,4 +22,3 @@ class JsSyntaxTest extends Test { ...@@ -22,4 +22,3 @@ class JsSyntaxTest extends Test {
return 'JsSyntaxTest'; return 'JsSyntaxTest';
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment