Re: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, do you think that you could just help me to understand the code a little? The arrow below points to where I am getting the error "Warning: Invalid argument supplied for foreach() in > var/www/nutsmail/functions/attachment_common.php on line 44."  I tried using sm_print_r($attachment_common_types,debug_backtrace()) to trace back where the variable is passed but. I am just confused. I have included what I get from the trace as well. What is sqgetGlobalVar('attachment_common_types', $attachment_common_types) doing? Is it looking for the session variable and setting it or is it setting $attachment_common_types= 'attachment_common_types'?





<?php

/**
 * attachment_common.php
 *
 * This file provides the handling of often-used attachment types.
 *
 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version $Id: attachment_common.php,v 1.25.2.9 2006/04/14 22:27:07 jervfors Exp $
 * @package squirrelmail
 */

/**
 * FIXME Needs phpDocumentator style documentation
 */
require_once(SM_PATH . 'functions/global.php');

global $attachment_common_show_images_list;
$attachment_common_show_images_list = array();

global $FileExtensionToMimeType, $attachment_common_types;
$FileExtensionToMimeType = array('bmp'  => 'image/x-bitmap',
                                 'gif'  => 'image/gif',
                                 'htm'  => 'text/html',
                                 'html' => 'text/html',
                                 'jpg'  => 'image/jpeg',
                                 'jpeg' => 'image/jpeg',
                                 'php'  => 'text/plain',
                                 'png'  => 'image/png',
                                 'rtf'  => 'text/richtext',
                                 'txt'  => 'text/plain',
                                 'patch'=> 'text/plain',
                                 'vcf'  => 'text/x-vcard');

/* Register browser-supported image types */
sqgetGlobalVar('attachment_common_types', $attachment_common_types);
if (isset($attachment_common_types)) {
    // var is used to detect activation of jpeg image types
    unset($jpeg_done);

/* Don't run this before being logged in. That may happen
       when plugins include mime.php */
sm_print_r($attachment_common_types,debug_backtrace());

    foreach ($attachment_common_types as $val => $v) { <-------------------------------------------------
        if ($val == 'image/gif')
            register_attachment_common('image/gif',       'link_image');
        elseif (($val == 'image/jpeg' || $val == 'image/pjpeg') and
                (!isset($jpeg_done))) {
            $jpeg_done = 1;
            register_attachment_common('image/jpeg',      'link_image');
            register_attachment_common('image/pjpeg',     'link_image');
        }
        elseif ($val == 'image/png')
            register_attachment_common('image/png',       'link_image');
        elseif ($val == 'image/x-xbitmap')
            register_attachment_common('image/x-xbitmap', 'link_image');
        elseif ($val == '*/*' || $val == 'image/*') {
            /**
             * browser (Firefox) declared that anything is acceptable.


 
 
 sm_print_r($attachment_common_types,debug_backtrace())-OUTPUT
attachment_common_types
Array
(
    [0] => Array
        (
            [file] => /var/www/nutsmail/functions/mime.php
            [line] => 17
            [function] => require_once
        )

    [1] => Array
        (
            [file] => /var/www/nutsmail/functions/imap_search.php
            [line] => 22
            [args] => Array
                (
                    [0] => /var/www/nutsmail/functions/mime.php
                )

            [function] => require_once
        )

    [2] => Array
        (
            [file] => /var/www/nutsmail/functions/imap.php
            [line] => 20
            [args] => Array
                (
                    [0] => /var/www/nutsmail/functions/imap_search.php
                )

            [function] => require_once
        )

    [3] => Array
        (
            [file] => /var/www/nutsmail/src/webmail.php
            [line] => 27
            [args] => Array
                (
                    [0] => /var/www/nutsmail/functions/imap.php
                )

            [function] => require_once
        )

)

-----Original Message-----
From: Tomas Kuliavas [mailto:tokul@xxxxxxxxxxxxxxxxxxxxx] 
Sent: Monday, June 13, 2011 3:23 PM
To: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
Subject: Re:  squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx



Dougan, Linda A wrote:
> 
> SquirrelMail version:
> 
> 1.4.7
> 
> Config file version:
> 
> 1.4.0
> 
> Config file last modified:
> 
> 10 June 2009 15:40:00
> 
> 
> Checking PHP configuration...
>     PHP version 5.3.6-pl0-gentoo OK.
>     PHP extensions OK.
> Checking paths...
> 
> 
>  After upgrading php I getting this error.
> 
> Warning: Invalid argument supplied for foreach() in
> /var/www/nutsmail/functions/attachment_common.php on line 44.
> ...
> Can anyone help me?
> 
Your error code shows that you use SquirrelMail with custom modifications
unsupported by SquirrelMail developers. Reported version does not indicate
upgrade. You have old SquirrelMail code version running on new PHP.

Technically SquirrelMail is not your webmail vendor. Contact people who
created that mod and ask for updates. If you want to get help here, you must
publish modifications made in that package. You can't do that for 1.4.7 as
they mix proprietary images with GPLed code and only newer packages separate
themes from GPL code.

-- 
Tomas
-- 
View this message in context: http://old.nabble.com/squirrelmail-users%40lists.sourceforge.net-tp31837031p31837151.html
Sent from the squirrelmail-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users



[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux