X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fattachment_common.php;h=ad36120b508810a160f38a7e3d9a7a0d2fea2e93;hb=a2e66c6d35a0a73d8d9f48af1288a34f83219ec6;hp=3ee385a362a7b402ae7ec95525234cb97ba64383;hpb=47f9a69dfa138fef170a7cdd9fe4556fc11f55a4;p=squirrelmail.git diff --git a/functions/attachment_common.php b/functions/attachment_common.php index 3ee385a3..ad36120b 100644 --- a/functions/attachment_common.php +++ b/functions/attachment_common.php @@ -3,7 +3,7 @@ /** * attachment_common.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * This file provides the handling of often-used attachment types. @@ -11,6 +11,8 @@ * $Id$ */ +require_once(SM_PATH . 'functions/global.php'); + global $attachment_common_show_images_list; $attachment_common_show_images_list = array(); @@ -28,6 +30,7 @@ $FileExtensionToMimeType = array('bmp' => 'image/x-bitmap', 'vcf' => 'text/x-vcard'); /* Register browser-supported image types */ +sqgetGlobalVar('attachment_common_types', $attachment_common_types); if (isset($attachment_common_types)) { /* Don't run this before being logged in. That may happen when plugins include mime.php */ @@ -60,6 +63,7 @@ register_attachment_common('text/html', 'link_html'); /* Register vcards */ register_attachment_common('text/x-vcard', 'link_vcard'); +register_attachment_common('text/directory', 'link_vcard'); /* Register rules for general types. * These will be used if there isn't a more specific rule available. */ @@ -93,9 +97,9 @@ function attachment_common_link_text(&$Args) $Args[1]['attachment_common']['href'] = Where it links to This sets the 'href' of this plugin for a new link. */ - - global $QUERY_STRING; - $Args[1]['attachment_common']['href'] = '../src/view_text.php?'. $QUERY_STRING; + sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER); + + $Args[1]['attachment_common']['href'] = SM_PATH . 'src/view_text.php?'. $QUERY_STRING; $Args[1]['attachment_common']['href'] = set_url_var($Args[1]['attachment_common']['href'], 'ent_id',$Args[5]); @@ -117,7 +121,7 @@ function attachment_common_link_text(&$Args) function attachment_common_link_message(&$Args) { - $Args[1]['attachment_common']['href'] = '../src/read_body.php?startMessage=' . + $Args[1]['attachment_common']['href'] = SM_PATH . 'src/read_body.php?startMessage=' . $Args[2] . '&passed_id=' . $Args[3] . '&mailbox=' . $Args[4] . '&passed_ent_id=' . $Args[5] . '&override_type0=message&override_type1=rfc822'; /* The link that we created needs a name. "view" will be displayed for @@ -128,10 +132,11 @@ function attachment_common_link_message(&$Args) } -function attachment_common_link_html(&$Args) +function attachment_common_link_html(&$Args) { - global $QUERY_STRING; - $Args[1]['attachment_common']['href'] = '../src/view_text.php?'. $QUERY_STRING. + sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER); + + $Args[1]['attachment_common']['href'] = SM_PATH . 'src/view_text.php?'. $QUERY_STRING. /* why use the overridetype? can this be removed */ '&override_type0=text&override_type1=html'; $Args[1]['attachment_common']['href'] = @@ -146,15 +151,16 @@ function attachment_common_link_html(&$Args) function attachment_common_link_image(&$Args) { global $attachment_common_show_images, $attachment_common_show_images_list; - + + sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER); + $info['passed_id'] = $Args[3]; $info['mailbox'] = $Args[4]; $info['ent_id'] = $Args[5]; $attachment_common_show_images_list[] = $info; - global $QUERY_STRING; - $Args[1]['attachment_common']['href'] = '../src/image.php?'. $QUERY_STRING; + $Args[1]['attachment_common']['href'] = SM_PATH . 'src/image.php?'. $QUERY_STRING; $Args[1]['attachment_common']['href'] = set_url_var($Args[1]['attachment_common']['href'], 'ent_id',$Args[5]); @@ -168,8 +174,9 @@ function attachment_common_link_image(&$Args) function attachment_common_link_vcard(&$Args) { - global $QUERY_STRING; - $Args[1]['attachment_common']['href'] = '../src/vcard.php?'. $QUERY_STRING; + sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER); + + $Args[1]['attachment_common']['href'] = SM_PATH . 'src/vcard.php?'. $QUERY_STRING; $Args[1]['attachment_common']['href'] = set_url_var($Args[1]['attachment_common']['href'], 'ent_id',$Args[5]);