Fixed bug #53854 (Missing constants for compression type). Patch by Richard

Quadling.
This commit is contained in:
Adam Harvey 2011-01-28 04:19:40 +00:00
parent 0393cf77fc
commit d56de24ce7
3 changed files with 51 additions and 0 deletions

1
NEWS
View File

@ -146,6 +146,7 @@
gmail dot com, Gustavo)
. Fixed bug #53166 (Missing parameters in docs and reflection definition).
(Richard)
. Fixed bug #53854 (Missing constants for compression type). (Richard, Adam)
06 Jan 2011, PHP 5.3.5
- Fixed Bug #53632 (infinite loop with x87 fpu). (CVE-2010-4645) (Scott,

View File

@ -2754,6 +2754,12 @@ static PHP_MINIT_FUNCTION(zip)
REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE", ZIP_CM_DEFLATE);
REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE64", ZIP_CM_DEFLATE64);
REGISTER_ZIP_CLASS_CONST_LONG("CM_PKWARE_IMPLODE", ZIP_CM_PKWARE_IMPLODE);
REGISTER_ZIP_CLASS_CONST_LONG("CM_BZIP2", ZIP_CM_BZIP2);
REGISTER_ZIP_CLASS_CONST_LONG("CM_LZMA", ZIP_CM_LZMA);
REGISTER_ZIP_CLASS_CONST_LONG("CM_TERSE", ZIP_CM_TERSE);
REGISTER_ZIP_CLASS_CONST_LONG("CM_LZ77", ZIP_CM_LZ77);
REGISTER_ZIP_CLASS_CONST_LONG("CM_WAVPACK", ZIP_CM_WAVPACK);
REGISTER_ZIP_CLASS_CONST_LONG("CM_PPMD", ZIP_CM_PPMD);
/* Error code */
REGISTER_ZIP_CLASS_CONST_LONG("ER_OK", ZIP_ER_OK); /* N No error */

View File

@ -0,0 +1,44 @@
--TEST--
Bug #53854 (Missing constants for compression type)
--SKIPIF--
<?php
if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
var_dump(ZipArchive::CM_DEFAULT);
var_dump(ZipArchive::CM_STORE);
var_dump(ZipArchive::CM_SHRINK);
var_dump(ZipArchive::CM_REDUCE_1);
var_dump(ZipArchive::CM_REDUCE_2);
var_dump(ZipArchive::CM_REDUCE_3);
var_dump(ZipArchive::CM_REDUCE_4);
var_dump(ZipArchive::CM_IMPLODE);
var_dump(ZipArchive::CM_DEFLATE);
var_dump(ZipArchive::CM_DEFLATE64);
var_dump(ZipArchive::CM_PKWARE_IMPLODE);
var_dump(ZipArchive::CM_BZIP2);
var_dump(ZipArchive::CM_LZMA);
var_dump(ZipArchive::CM_TERSE);
var_dump(ZipArchive::CM_LZ77);
var_dump(ZipArchive::CM_WAVPACK);
var_dump(ZipArchive::CM_PPMD);
--EXPECT--
int(-1)
int(0)
int(1)
int(2)
int(3)
int(4)
int(5)
int(6)
int(8)
int(9)
int(10)
int(12)
int(14)
int(18)
int(19)
int(97)
int(98)