Welcome Guest, Not a member yet? Register   Sign In
Missing .htaccess in zip file
#6

[eluser]bubbafoley[/eluser]
read_dir() ignores hidden files. You'll need to use read_file() to add the .htaccess file

system/libraries/Zip.php
Code:
function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL)
    {
        if ( ! $fp = @opendir($path))
        {
            return FALSE;
        }

        // Set the original directory root for child dir's to use as relative
        if ($root_path === NULL)
        {
            $root_path = dirname($path).'/';
        }

        while (FALSE !== ($file = readdir($fp)))
        {
            // ignoring hidden files
            if (substr($file, 0, 1) == '.')
            {
                continue;
            }

            if (@is_dir($path.$file))
            {
                $this->read_dir($path.$file."/", $preserve_filepath, $root_path);
            }
            else
            {
                if (FALSE !== ($data = file_get_contents($path.$file)))
                {
                    $name = str_replace("\\", "/", $path);

                    if ($preserve_filepath === FALSE)
                    {
                        $name = str_replace($root_path, '', $name);
                    }

                    $this->add_data($name.$file, $data);
                }
            }
        }

        return TRUE;
    }


Messages In This Thread
Missing .htaccess in zip file - by El Forum - 03-08-2011, 01:55 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 09:38 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 09:43 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 10:17 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 10:26 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:32 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:35 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:48 PM
Missing .htaccess in zip file - by El Forum - 03-08-2011, 11:55 PM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:15 AM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:54 AM
Missing .htaccess in zip file - by El Forum - 03-09-2011, 11:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB