Statement on glibc/iconv Vulnerability

ZipArchive::getArchiveFlag

(PHP >= 8.3.0, PECL zip >= 1.22.0)

ZipArchive::getArchiveFlagZip アーカイブのグローバルフラグの値を返す

説明

public ZipArchive::getArchiveFlag(int $flag = 0, int $flags = 0): int

Zip アーカイブのグローバルフラグの値を返します。

パラメータ

flag

取得するグローバルフラグ。 以下の定数 AFL_* から選びます:

flags

ZipArchive::FL_UNCHANGED が設定された場合、 もともと設定されていた値が返されます。

戻り値

アーカイブにフラグが設定されている場合は、1 を返します。 設定されていない場合は 0 を返します。 エラーが発生した場合は -1 を返します。

例1 アーカイブが torrentzip フォーマットかを調べる

<?php
$zip
= new ZipArchive;
$res = $zip->open('test.zip');
if (
$res === TRUE) {
var_dump($zip->getArchiveFlag(ZipArchive::AFL_IS_TORRENTZIP));
} else {
echo
'failed, code:' . $res;
}
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top