diff --git a/app/access_controls/app_defaults.php b/app/access_controls/app_defaults.php index fa495a4e0f..d523573520 100644 --- a/app/access_controls/app_defaults.php +++ b/app/access_controls/app_defaults.php @@ -48,9 +48,6 @@ else { $xml_string = "\n"; $xml_string .= " \n"; - $xml_string .= " \n"; - $xml_string .= " \n"; - $xml_string .= " \n"; $xml_string .= " \n"; $xml_string .= " \n"; $xml_string .= " \n"; diff --git a/app/fax/resources/functions/parse_attachments.php b/app/fax/resources/functions/parse_attachments.php new file mode 100644 index 0000000000..59860d0b6a --- /dev/null +++ b/app/fax/resources/functions/parse_attachments.php @@ -0,0 +1,48 @@ +parts) && count($structure->parts)) { + + for($i = 0; $i < count($structure->parts); $i++) { + + if($structure->parts[$i]->ifdparameters) { + foreach($structure->parts[$i]->dparameters as $object) { + if(strtolower($object->attribute) == 'filename') { + $attachments[$i]['is_attachment'] = true; + $attachments[$i]['filename'] = $object->value; + } + } + } + + if($structure->parts[$i]->ifparameters) { + foreach($structure->parts[$i]->parameters as $object) { + if(strtolower($object->attribute) == 'name') { + $attachments[$i]['is_attachment'] = true; + $attachments[$i]['name'] = $object->value; + } + } + } + + if($attachments[$i]['is_attachment']) { + $attachments[$i]['attachment'] = imap_fetchbody($connection, $message_number, $i+1, $option); + if($structure->parts[$i]->encoding == 3) { // 3 = BASE64 + $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']); + $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); + } + elseif($structure->parts[$i]->encoding == 4) { // 4 = QUOTED-PRINTABLE + $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']); + $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); + } + } + + unset($attachments[$i]['is_attachment']); + } + + } + return array_values($attachments); //reindex +} + +?> diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 2383c31834..0eaec3213a 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -116,10 +116,10 @@ else { //get the list $sql = str_replace('count(*) as num_rows', '*', $sql); if (strlen($order_by) > 0) { - $sql .= ($order_by == 'voicemail_id') ? "order by voicemail_id ".$order." " : "order by ".$order_by." ".$order." "; + $sql .= ($order_by == 'voicemail_id') ? "order by cast(voicemail_id as int) ".$order." " : "order by ".$order_by." ".$order." "; } else { - $sql .= "order by voicemail_id asc "; + $sql .= "order by cast(voicemail_id as int) asc "; } $sql .= "limit ".$rows_per_page." offset ".$offset." "; $prep_statement = $db->prepare(check_sql($sql)); diff --git a/resources/classes/event_socket.php b/resources/classes/event_socket.php index 101bc5b738..74353bad44 100644 --- a/resources/classes/event_socket.php +++ b/resources/classes/event_socket.php @@ -164,7 +164,7 @@ class event_socket { public function close() { if ($this->fp) { - fclose($fp->fp); + fclose($this->fp); $this->fp = false; } }