• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set_allowed_types() in Upload library. Mistery?

#3
[eluser]Ignacio[/eluser]
The function make an array with the values from $config['allowed_types'] to compare with the mimes array.

config here:
Code:
$config['allowed_types'] = 'gif|jpg|png';

the MAGIC function here:
Code:
function set_allowed_types($types)
{
    $this->allowed_types = explode('|', $types);
}

for here:
Code:
foreach ($this->allowed_types as $val)
{
    $mime = $this->mimes_types(strtolower($val));

    if (is_array($mime))
    {
        if (in_array($this->file_type, $mime, TRUE))
        {
            return TRUE;
        }
    }
    else
    {
        if ($mime == $this->file_type)
        {
            return TRUE;
        }    
    }        
}

I can't understand how set_allowed_types() is it working and not calling it anywhere.


Messages In This Thread
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-12-2008, 07:15 PM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-12-2008, 10:08 PM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-13-2008, 12:41 AM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-13-2008, 12:57 AM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-13-2008, 01:00 AM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-13-2008, 01:01 AM
set_allowed_types() in Upload library. Mistery? - by El Forum - 12-13-2008, 01:05 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.