diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php index dedfba84c028c19a8f1bbe62a091e0ab337bffff..644d866637383fb9faadfce643616a280e8e2d52 100644 --- a/include/class.mailfetch.php +++ b/include/class.mailfetch.php @@ -19,7 +19,6 @@ require_once(INCLUDE_DIR.'class.ticket.php'); require_once(INCLUDE_DIR.'class.dept.php'); require_once(INCLUDE_DIR.'class.email.php'); require_once(INCLUDE_DIR.'class.filter.php'); -require_once(INCLUDE_DIR.'html2text.php'); require_once(INCLUDE_DIR.'tnef_decoder.php'); class MailFetcher { @@ -441,7 +440,8 @@ class MailFetcher { array('attachment', 'inline'))) { $filename = $this->findFilename($part->dparameters); } - // Inline attachments without disposition. + // Inline attachments without disposition. NOTE that elseif is + // not utilized here b/c ::findFilename may return null if (!$filename && $part->ifparameters && $part->parameters && $part->type > 0) { $filename = $this->findFilename($part->parameters); @@ -450,6 +450,13 @@ class MailFetcher { $content_id = ($part->ifid) ? rtrim(ltrim($part->id, '<'), '>') : false; + // Some mail clients / servers (like Lotus Notes / Domino) will + // send images without a filename. For such a case, generate a + // random filename for the image + if (!$filename && $content_id && $part->type == 5) { + $filename = 'image-'.Misc::randCode(4).'.'.strtolower($part->subtype); + } + if($filename) { return array( array( diff --git a/include/class.mailparse.php b/include/class.mailparse.php index 654e0e05ed66d7a8bca9af76d3e9e3db9ba601dc..f3feaf25d5e2678a4be426ab36e898dcd48782a2 100644 --- a/include/class.mailparse.php +++ b/include/class.mailparse.php @@ -367,10 +367,19 @@ class Mail_Parse { // Support attachments that do not specify a content-disposition // but do specify a "name" parameter in the content-type header. elseif (isset($part->ctype_parameters['name'])) - $filename=$part->ctype_parameters['name']; + $filename = $part->ctype_parameters['name']; elseif (isset($part->ctype_parameters['name*'])) $filename = Format::decodeRfc5987( $part->ctype_parameters['name*']); + + // Some mail clients / servers (like Lotus Notes / Domino) will + // send images without a filename. For such a case, generate a + // random filename for the image + elseif (isset($part->headers['content-id']) + && $part->headers['content-id'] + && 0 === strcasecmp($part->ctype_primary, 'image')) + $filename = 'image-'.Misc::randCode(4).'.' + .strtolower($part->ctype_secondary); else // Not an attachment? return false; diff --git a/include/class.staff.php b/include/class.staff.php index 9ab47f6b4e4bbdfb14f939535ebbb8cf7d852420..2c60d98d09b054644717e67bbf93a1581cbf0aec 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -396,8 +396,7 @@ class Staff extends AuthenticatedUser { } function showAssignedTickets() { - return ($this->ht['show_assigned_tickets'] - && ($this->isAdmin() || $this->isManager())); + return ($this->ht['show_assigned_tickets']); } function getTeams() { diff --git a/include/class.thread.php b/include/class.thread.php index fbe50bc87cdfaf94447b1167837041d65aa53574..fb180a767b027fa12ee99cfe71e8f441cb2cc92a 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -1047,7 +1047,7 @@ Class ThreadEntry { // content-id will be discarded, only the unique hash-code // will be available to retrieve the image later if ($a['cid'] && $a['key']) { - $body = str_replace('src="cid:'.$a['cid'].'"', + $body = preg_replace('/src=("|\'|\b)cid:'.$a['cid'].'\1/i', 'src="cid:'.$a['key'].'"', $body); } } diff --git a/include/class.topic.php b/include/class.topic.php index ee5ffc7194b78851bff6a12e912bd76f36b664ff..18bda5a536b232f5b1f3ae71176df8f76046d466 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -271,4 +271,6 @@ class Topic { return false; } } -?> + +// Add fields from the standard ticket form to the ticket filterable fields +Filter::addSupportedMatches('Help Topic', array('topicId' => 'Topic ID')); diff --git a/include/staff/profile.inc.php b/include/staff/profile.inc.php index 116a39eab0617425965850687298f47999bfb77d..5c73661a5cef1acd3c9ae0751e034b02f2ba8335 100644 --- a/include/staff/profile.inc.php +++ b/include/staff/profile.inc.php @@ -193,9 +193,6 @@ $info['id']=$staff->getId(); <span class="error"> <?php echo $errors['default_paper_size']; ?></span> </td> </tr> - <?php - //Show an option to show assigned tickets to admins & managers. - if($staff->isAdmin() || $staff->isManager()){ ?> <tr> <td>Show Assigned Tickets:</td> <td> @@ -203,7 +200,6 @@ $info['id']=$staff->getId(); <em>Show assigned tickets on open queue.</em> </td> </tr> - <?php } ?> <tr> <th colspan="2"> <em><strong>Password</strong>: To reset your password, provide your current password and a new password below. <span class="error"> <?php echo $errors['passwd']; ?></span></em>