contacts php 8.1 changes (#6730)
* Update contacts_vcard.php * Update vcard.php * Update contact_edit.php * Update contact_view.php * Update contact_phone_edit.php * Update contact_address_edit.php * Update contact_addresses.php * Update contact_addresses_view.php * Update contact_attachment.php * Update contact_attachment_edit.php * Update contact_attachments.php * Update contact_attachments_view.php * Update contact_email_edit.php * Update contact_emails.php * Update contact_emails_view.php * Update contact_extensions.php * Update contact_extensions_view.php * Update contact_import.php * Update contact_import_google.php * Update contact_json.php * Update contact_note_edit.php * Update contact_notes.php * Update contact_notes_view.php * Update contact_phones.php * Update contact_phones_view.php * Update contact_relation_edit.php * Update contact_emails_view.php * Update contact_addresses_view.php * Update contact_relations.php * Update contact_relations_view.php * Update contact_setting_edit.php * Update contact_settings.php * Update contact_time_edit.php * Update contact_timer.php * Update contact_timer_inc.php * Update contact_times.php * Update contact_url_edit.php * Update contact_urls.php * Update contact_urls_view.php * Update contact_import.php * Update contact_import.php * Update contact_email_edit.php * Update contact_url_edit.php * Update contact_relation_edit.php * Update contact_note_edit.php * Update contact_setting_edit.php * Update contact_attachment_edit.php * Update contact_edit.php * Update contact_phones_view.php * Update contact_note_edit.php * Update contact_attachment_edit.php * Update contact_phones_view.php * Update contact_edit.php * Update contacts.php * Update contact_edit.php * Update contact_edit.php * Update contact_edit.php * Update contact_edit.php * Update contact_edit.php * Update contact_phone_edit.php * Update contact_addresses.php * Update contact_addresses_view.php * Update contact_attachment_edit.php * Update contact_attachments.php * Update contact_attachments_view.php * Update contact_edit.php * Update contact_email_edit.php * Update contact_emails.php * Update contact_emails_view.php * Update contact_extensions.php * Update contact_extensions_view.php * Update contact_import.php * Update contact_import_google.php * Update contact_json.php * Update contact_note_edit.php * Update contact_notes.php * Update contact_notes_view.php * Update contact_phone_edit.php * Update contact_phones.php * Update contact_phones_view.php * Update contact_relations.php * Update contact_relations_view.php * Update contact_setting_edit.php * Update contact_settings.php * Update contact_time_edit.php * Update contact_timer.php * Update contact_timer_inc.php * Update contact_times.php * Update contact_url_edit.php * Update contact_urls.php * Update contact_urls_view.php * Update contact_view.php * Update contacts.php * Update contacts_vcard.php
This commit is contained in:
@@ -36,11 +36,11 @@
|
||||
$text = $language->get();
|
||||
|
||||
//get attachment uuid
|
||||
$contact_attachment_uuid = $_GET['id'];
|
||||
$action = $_GET['action'];
|
||||
$contact_attachment_uuid = $_GET['id'] ?? '';
|
||||
$action = $_GET['action'] ?? '';
|
||||
|
||||
//get media
|
||||
if (is_uuid($contact_attachment_uuid)) {
|
||||
if (!empty($contact_attachment_uuid) && is_uuid($contact_attachment_uuid)) {
|
||||
|
||||
$sql = "select attachment_filename, attachment_content from v_contact_attachments ";
|
||||
$sql .= "where contact_attachment_uuid = :contact_attachment_uuid ";
|
||||
@@ -48,15 +48,15 @@
|
||||
$parameters['contact_attachment_uuid'] = $contact_attachment_uuid;
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$attachment = $database->select($sql, $parameters, 'row');
|
||||
$attachment = $database->select($sql, $parameters ?? null, 'row');
|
||||
unset($sql, $parameters);
|
||||
|
||||
$attachment_type = strtolower(pathinfo($attachment['attachment_filename'], PATHINFO_EXTENSION));
|
||||
$attachment_type = strtolower(pathinfo($attachment['attachment_filename'] ?? '', PATHINFO_EXTENSION));
|
||||
|
||||
//determine mime type
|
||||
$content_type = 'application/octet-stream'; //set default
|
||||
$allowed_attachment_types = json_decode($_SESSION['contacts']['allowed_attachment_types']['text'], true);
|
||||
if (is_array($allowed_attachment_types) && sizeof($allowed_attachment_types) != 0) {
|
||||
$allowed_attachment_types = json_decode($_SESSION['contacts']['allowed_attachment_types']['text'] ?? '', true);
|
||||
if (!empty($allowed_attachment_types)) {
|
||||
if ($allowed_attachment_types[$attachment_type] != '') {
|
||||
$content_type = $allowed_attachment_types[$attachment_type];
|
||||
}
|
||||
@@ -82,4 +82,4 @@
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user