Changeset 4786 for extensions/netinstall


Ignore:
Timestamp:
Jan 28, 2010, 11:07:16 PM (14 years ago)
Author:
patdenice
Message:

Ignore directory beginning by _

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/netinstall/trunk/piwigo-netinstall.php

    r3422 r4786  
    472472                                $uz = new fileUnzip($dc_zip);
    473473                                $files = $uz->getList();
    474                                 if (count($files) == 0)
     474                                if (!is_array($files) or count($files) == 0)
    475475                                {
    476476                                        $msg[] = l10n('Invalid zip file.');
    477477                                }
    478 
    479                                 foreach ($files as $k => $v)
     478                                else
    480479                                {
    481                                         if ($v['is_dir'])
     480                                        foreach ($files as $k => $v)
     481                                        {
     482                                                if ($v['is_dir'])
     483                                                {
     484                                                        continue;
     485                                                }
     486                                        if (preg_match('#^[^/]*/_data#', $k))
    482487                                        {
    483488                                                continue;
    484489                                        }
    485                                         $t = preg_replace('#^[^/]*/#','./'.$dest.'/',$k);
    486                                         $uz->unzip($k,$t);
     490                                                $t = preg_replace('#^[^/]*/#','./'.$dest.'/',$k);
     491                                                $uz->unzip($k,$t);
     492                                        }
    487493                                }
    488494                                $uz->close;
Note: See TracChangeset for help on using the changeset viewer.