Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated Functions & TypeError L3100? #773

Closed
capric98 opened this issue Apr 12, 2022 · 2 comments
Closed

Deprecated Functions & TypeError L3100? #773

capric98 opened this issue Apr 12, 2022 · 2 comments

Comments

@capric98
Copy link

capric98 commented Apr 12, 2022

Env: alpine3.15 + PHP 8.0.17_r0

Logs:

WARNING: "PHP message: PHP Deprecated:  Function zip_open() is deprecated in tinyfilemanager.php on line 2600"
WARNING: "PHP message: PHP Deprecated:  Function zip_read() is deprecated in tinyfilemanager.php on line 2603"
WARNING: "PHP message: PHP Deprecated:  Function zip_entry_name() is deprecated in tinyfilemanager.php on line 2604"
WARNING: "PHP message: PHP Deprecated:  Function zip_entry_filesize() is deprecated in tinyfilemanager.php on line 2608"
WARNING: "PHP message: PHP Deprecated:  Function zip_entry_compressedsize() is deprecated in tinyfilemanager.php on line 2609"
WARNING: "PHP message: PHP Deprecated:  Function zip_close() is deprecated in tinyfilemanager.php on line 2614"
WARNING: "PHP message: PHP Warning:  A non-numeric value encountered in tinyfilemanager.php on line 3084"
WARNING: "PHP message: PHP Fatal error:  Uncaught TypeError: fseek(): Argument #2 ($offset) must be of type int, string given in tinyfilemanager.php:3100"
WARNING: "Stack trace:"
WARNING: "#0 tinyfilemanager.php(3100): fseek()"
WARNING: "#1 tinyfilemanager.php(858): fm_download_file()"
WARNING: "#2 {main}"
WARNING: "  thrown in tinyfilemanager.php on line 3100"

Line 2600-2616

$arch = zip_open($path);
if ($arch) {
    $filenames = array();
    while ($zip_entry = zip_read($arch)) {
        $zip_name = zip_entry_name($zip_entry);
        $zip_folder = substr($zip_name, -1) == '/';
        $filenames[] = array(
            'name' => $zip_name,
            'filesize' => zip_entry_filesize($zip_entry),
            'compressed_size' => zip_entry_compressedsize($zip_entry),
            'folder' => $zip_folder
            //'compression_method' => zip_entry_compressionmethod($zip_entry),
        );
    }
    zip_close($arch);
    return $filenames;
}

Line 3076-3100

header("Accept-Ranges: bytes");
$range = 0;
$size = filesize($fileLocation);

if (isset($_SERVER['HTTP_RANGE'])) {
    list($a, $range) = explode("=", $_SERVER['HTTP_RANGE']);
    str_replace($range, "-", $range);
    $size2 = $size - 1;
    $new_length = $size - $range; # L3084
    header("HTTP/1.1 206 Partial Content");
    header("Content-Length: $new_length");
    header("Content-Range: bytes $range$size2/$size");
} else {
    $size2 = $size - 1;
    header("Content-Range: bytes 0-$size2/$size");
    header("Content-Length: " . $size);
}

if ($size == 0) {
    die('Zero byte file! Aborting download');
}
@ini_set('magic_quotes_runtime', 0);
$fp = fopen("$fileLocation", "rb");

fseek($fp, $range); # L3100
@rupkoe
Copy link

rupkoe commented Oct 31, 2022

PHP's zip functions are deprecated starting from PHP 8.0, see https://www.php.net/manual/en/ref.zip.php

@prasathmani
Copy link
Owner

This issue is addressed in the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants