mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-22 08:26:38 +00:00
Compare commits
159
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0843bcd6f6 | ||
|
|
10642aa9e4 | ||
|
|
645f84e41b | ||
|
|
7e3e1837c8 | ||
|
|
9762609cec | ||
|
|
f419d614ba | ||
|
|
880a6cee00 | ||
|
|
14cebefb05 | ||
|
|
015ee3b2c8 | ||
|
|
068fc008c6 | ||
|
|
b477a84026 | ||
|
|
ef7286a42f | ||
|
|
5799ebdb0c | ||
|
|
ffa8461bfe | ||
|
|
777b6679a4 | ||
|
|
ead076bac6 | ||
|
|
cc30524c89 | ||
|
|
683b4f7a2b | ||
|
|
bd39495332 | ||
|
|
88f7f3c00f | ||
|
|
86b4252c8e | ||
|
|
63f3962a90 | ||
|
|
864575251a | ||
|
|
02b8362ec2 | ||
|
|
ad7eeba3c1 | ||
|
|
896d0fcd41 | ||
|
|
b383ddf1e5 | ||
|
|
bcf5853eaa | ||
|
|
c819cf9d6b | ||
|
|
b2b018d5f7 | ||
|
|
26b37f1792 | ||
|
|
157ddd9577 | ||
|
|
88f46b162b | ||
|
|
6b2b195267 | ||
|
|
bcc87ba68e | ||
|
|
d80ff39189 | ||
|
|
250393f925 | ||
|
|
5f31c81f07 | ||
|
|
75d8af715c | ||
|
|
8fe87e7fea | ||
|
|
1ac611f24f | ||
|
|
e6cf7d7745 | ||
|
|
f826ea093f | ||
|
|
7e8276ca68 | ||
|
|
974324676b | ||
|
|
b025b9d0cf | ||
|
|
4662151ea7 | ||
|
|
bc0972e78d | ||
|
|
ad2bee193d | ||
|
|
ce2082d24f | ||
|
|
e427182279 | ||
|
|
5b3f4d25ea | ||
|
|
84fe2cc890 | ||
|
|
cc90ac54be | ||
|
|
c3f34796a0 | ||
|
|
84b1c568f4 | ||
|
|
a62d4e2c43 | ||
|
|
b8e946b02e | ||
|
|
055ecbc628 | ||
|
|
d93892de7a | ||
|
|
5d81fe6f12 | ||
|
|
fed1f2d124 | ||
|
|
e793539678 | ||
|
|
f072662621 | ||
|
|
a8948d0808 | ||
|
|
592917f91f | ||
|
|
6176b96a23 | ||
|
|
d3780f1f90 | ||
|
|
26cb570615 | ||
|
|
f0d6059389 | ||
|
|
f464ffd780 | ||
|
|
cda14b995c | ||
|
|
17c0ff1194 | ||
|
|
fc74503792 | ||
|
|
7d04e0fb2e | ||
|
|
baacc2cb13 | ||
|
|
9ecb67d5a4 | ||
|
|
bde0e8c2a1 | ||
|
|
8ca457f64d | ||
|
|
e883892664 | ||
|
|
b8cdc731b8 | ||
|
|
a37e84e549 | ||
|
|
f4a44f18b8 | ||
|
|
a39bcfc5ee | ||
|
|
9a2365412e | ||
|
|
335a11b14b | ||
|
|
7cae4ff02c | ||
|
|
018a9b321f | ||
|
|
4e6f27f4db | ||
|
|
fed5923dbc | ||
|
|
c56ff39c05 | ||
|
|
6ecc9f1d9d | ||
|
|
d9810af45a | ||
|
|
c1ac325228 | ||
|
|
52d541a314 | ||
|
|
45b3fa4dee | ||
|
|
15213768e6 | ||
|
|
9b233b7e5e | ||
|
|
4fc49c04df | ||
|
|
d57b278ad1 | ||
|
|
e59b6dc0ae | ||
|
|
38ca8cb7a1 | ||
|
|
35abf3f20c | ||
|
|
59e0930d37 | ||
|
|
1f5327a602 | ||
|
|
fa05f038cb | ||
|
|
a331f43f8c | ||
|
|
aab49e934d | ||
|
|
8d5e953a19 | ||
|
|
ad0371ac7e | ||
|
|
b4b0aaae93 | ||
|
|
dbc727373c | ||
|
|
4054890b26 | ||
|
|
72911237b5 | ||
|
|
2f7bd57f93 | ||
|
|
e7ff3e839b | ||
|
|
0298b92b69 | ||
|
|
f6655b62d8 | ||
|
|
63e11f9025 | ||
|
|
a7761262f7 | ||
|
|
bf9120ecae | ||
|
|
c3547f1935 | ||
|
|
86d2fafded | ||
|
|
4aac4da673 | ||
|
|
d4d36fba28 | ||
|
|
8fc9df3f67 | ||
|
|
cfea8e5d04 | ||
|
|
6c9056ceb7 | ||
|
|
abe0f17e88 | ||
|
|
11b4f3becd | ||
|
|
bde86a6639 | ||
|
|
85c777d2f1 | ||
|
|
f1969d4b4c | ||
|
|
2da2de46a8 | ||
|
|
e08566c613 | ||
|
|
9205c4fd62 | ||
|
|
c449bf1443 | ||
|
|
1c19146f46 | ||
|
|
1eff3b01b8 | ||
|
|
86ea921291 | ||
|
|
07c0d714a5 | ||
|
|
51286bd8e5 | ||
|
|
5d61e56dd7 | ||
|
|
812d248193 | ||
|
|
f4c38016b6 | ||
|
|
629273d11b | ||
|
|
7b396c078c | ||
|
|
f733173b1f | ||
|
|
a7df6ce664 | ||
|
|
621fddab93 | ||
|
|
faca4e08b4 | ||
|
|
c973fef48d | ||
|
|
645d65f3e3 | ||
|
|
778d69ddfe | ||
|
|
79d52503a4 | ||
|
|
6d928fd26d | ||
|
|
72a9b595ca | ||
|
|
67039363cd | ||
|
|
d4afbd487a |
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
@@ -1,6 +1,98 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.3.12
|
||||
16 Aug 2012, PHP 5.3.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
|
||||
with run-test.php). (Laruence)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
|
||||
(r.hampartsumyan@gmail.com, Laruence)
|
||||
|
||||
- DateTime:
|
||||
. Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
|
||||
result). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
|
||||
gives Segmentation fault). (Laruence, Gustavo)
|
||||
|
||||
19 Jul 2012, PHP 5.3.15
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
|
||||
includes a semi-colon). (Pierrick)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- Core:
|
||||
. Fixed potential overflow in _php_stream_scandir, CVE-2012-2688. (Jason
|
||||
Powell, Stas)
|
||||
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
|
||||
concurrent). (Johannes)
|
||||
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
|
||||
Salt). (Anthony Ferrara)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed magic file regex support. (Felipe)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
|
||||
. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
|
||||
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
|
||||
for non-root start). (fat)
|
||||
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
|
||||
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
|
||||
(fat)
|
||||
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
|
||||
can be launched without errors). (fat)
|
||||
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
|
||||
. Fixed bug #61218 (FPM drops connection while receiving some binary values
|
||||
in FastCGI requests). (fat)
|
||||
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
|
||||
. Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
|
||||
twice). (Gustavo)
|
||||
. Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
|
||||
. Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
|
||||
pattern). (Gustavo)
|
||||
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
|
||||
|
||||
- JSON:
|
||||
. Reverted fix for bug #61537. (Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62384 (Attempting to invoke a Closure more than once causes
|
||||
segfault). (Felipe)
|
||||
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
|
||||
with constant). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
|
||||
(Nikita Popov)
|
||||
|
||||
- SQLite:
|
||||
. Fixed open_basedir bypass, CVE-2012-3365. (Johannes, reported by Yury
|
||||
Maryshev)
|
||||
|
||||
- XML Writer:
|
||||
. Fixed bug #62064 (memory leak in the XML Writer module).
|
||||
(jean-pierre dot lozi at lip6 dot fr)
|
||||
|
||||
- Zip:
|
||||
. Upgraded libzip to 0.10.1 (Anatoliy)
|
||||
|
||||
14 Jun 2012, PHP 5.3.14
|
||||
|
||||
- CLI SAPI:
|
||||
. Fixed bug #61546 (functions related to current script failed when chdir()
|
||||
@@ -10,24 +102,40 @@ PHP NEWS
|
||||
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- Core:
|
||||
. Fixed CVE-2012-2143. (Solar Designer)
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed bug #62373 (serialize() generates wrong reference to the object).
|
||||
(Moriyoshi)
|
||||
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
|
||||
member of a null object). (Laruence)
|
||||
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
|
||||
reference). (Laruence)
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
|
||||
(Anatoliy)
|
||||
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Changed php://fd to be available only for CLI.
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #61812 (Uninitialised value used in libmagic).
|
||||
(Laruence, Gustavo)
|
||||
|
||||
- Iconv extension:
|
||||
. Fixed a bug that iconv extension fails to link to the correct library
|
||||
when another extension makes use of a library that links to the iconv
|
||||
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
|
||||
(Moriyoshi)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62082 (Memory corruption in internal function
|
||||
get_icu_disp_value_src_php()). (Gustavo)
|
||||
|
||||
- JSON
|
||||
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
|
||||
information). (Adam)
|
||||
@@ -39,12 +147,6 @@ PHP NEWS
|
||||
- Phar:
|
||||
. Fix bug #61065 (Secunia SA44335). (Rasmus)
|
||||
|
||||
- Iconv extension:
|
||||
. Fixed a bug that iconv extension fails to link to the correct library
|
||||
when another extension makes use of a library that links to the iconv
|
||||
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
|
||||
(Moriyoshi)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #61961 (file_get_contents leaks when access empty file with
|
||||
maxlen set). (Reeze)
|
||||
|
||||
@@ -479,6 +479,11 @@ UPGRADE NOTES - PHP 5.3
|
||||
- Firebird and SNMP support are no longer available on Windows. Firebird support
|
||||
may be reintroduced in the future.
|
||||
|
||||
- As of PHP 5.3.15 and above the COM extension isn't compiled statically in PHP
|
||||
anymore but shared. It'll still be delivered with the standard PHP release but
|
||||
must be activated manually with the "extension = php_com_dotnet.dll" directive
|
||||
in php.ini.
|
||||
|
||||
=====================
|
||||
11.1 New in PHP 5.3.4
|
||||
=====================
|
||||
|
||||
-22097
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,12 @@ Bug #55509 (segfault on x86_64 using more than 2G memory)
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die('skip Not for 32-bits OS');
|
||||
}
|
||||
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
// check the available memory
|
||||
if (PHP_OS == 'Linux') {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3)
|
||||
--XFAIL--
|
||||
see https://bugs.php.net/62680
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array("");
|
||||
var_dump(isset($array[0]["a"]["b"]));
|
||||
var_dump(isset($array[0]["a"]["b"]["c"]));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
+1
-1
@@ -1336,7 +1336,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
if (CG(current_namespace)) {
|
||||
/* Prefix function name with current namespcae name */
|
||||
/* Prefix function name with current namespace name */
|
||||
znode tmp;
|
||||
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
|
||||
+1
-1
@@ -331,7 +331,7 @@ END_EXTERN_C()
|
||||
if (idx-1 > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
idx = (ulong)(-(long)idx); \
|
||||
idx = 0 - idx; \
|
||||
} else if (idx > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
|
||||
+1612
-1574
File diff suppressed because it is too large.
Load diff
+27
-6
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^\n\r;\000]
|
||||
RAW_VALUE_CHARS [^"\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
@@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
return '=';
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
/* Eat leading and trailing double quotes */
|
||||
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
<ST_RAW>["] {
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '\n':
|
||||
SCNG(lineno)++;
|
||||
break;
|
||||
case '\r':
|
||||
if (*YYCURSOR != '\n') {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
break;
|
||||
case '"':
|
||||
yyleng = YYCURSOR - SCNG(yy_text) - 2;
|
||||
SCNG(yy_text)++;
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
|
||||
/* Generated by re2c 0.13.5 on Thu Jun 7 17:37:03 2012 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */
|
||||
#line 1 "Zend/zend_language_scanner.l"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -287,7 +287,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
zend_multibyte_set_filter(NULL TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
@@ -445,7 +445,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
|
||||
@@ -285,7 +285,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
zend_multibyte_set_filter(NULL TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
@@ -443,7 +443,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
|
||||
|
||||
if (!SCNG(input_filter)) {
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
|
||||
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
|
||||
SCNG(script_filtered_size) = SCNG(script_org_size);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1575,7 +1575,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
|
||||
Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
|
||||
zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
|
||||
@@ -2029,13 +2030,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
|
||||
|
||||
ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-2
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=16
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -65,7 +65,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
z->value.obj.handlers = &php_com_object_handlers;
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -92,7 +92,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
|
||||
/* this is a convenience function for fetching a particular
|
||||
* element from a (possibly multi-dimensional) safe array */
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
{
|
||||
UINT dims;
|
||||
LONG lbound, ubound;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "php_com_dotnet_internal.h"
|
||||
|
||||
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
|
||||
@@ -65,7 +65,7 @@ PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int c
|
||||
return olestring;
|
||||
}
|
||||
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
char *string;
|
||||
uint length = 0;
|
||||
|
||||
@@ -271,7 +271,7 @@ static void istream_destructor(php_istream *stm)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
|
||||
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
|
||||
*/
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
{
|
||||
ITypeLib *TL = NULL;
|
||||
char *strtok_buf, *major, *minor;
|
||||
@@ -153,7 +153,7 @@ PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_D
|
||||
}
|
||||
|
||||
/* Given a type-library, merge it into the current engine state */
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
{
|
||||
int i, j, interfaces;
|
||||
TYPEKIND pTKind;
|
||||
@@ -224,7 +224,7 @@ void php_com_typelibrary_dtor(void *pDest)
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC)
|
||||
{
|
||||
ITypeLib **TLp;
|
||||
|
||||
@@ -98,7 +98,7 @@ bogus:
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -166,7 +166,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
int ret = SUCCESS;
|
||||
@@ -258,7 +258,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
|
||||
}
|
||||
|
||||
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
{
|
||||
int ret = SUCCESS;
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ static void disp_destructor(php_dispatchex *disp)
|
||||
CoTaskMemFree(disp);
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
HashTable *id_to_name TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
|
||||
@@ -625,7 +625,7 @@ PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
return (IDispatch*)disp;
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = NULL;
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ extern zend_module_entry com_dotnet_module_entry;
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# define PHP_COM_DOTNET_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_COM_DOTNET_API
|
||||
#endif
|
||||
|
||||
PHP_MINIT_FUNCTION(com_dotnet);
|
||||
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
|
||||
PHP_RINIT_FUNCTION(com_dotnet);
|
||||
|
||||
@@ -87,9 +87,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
|
||||
|
||||
/* com_olechar.c */
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
uint *string_len, int codepage TSRMLS_DC);
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
|
||||
uint string_len, int codepage TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
|
||||
|
||||
/* com_wrapper.c */
|
||||
int php_com_wrapper_minit(INIT_FUNC_ARGS);
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
|
||||
/* com_persist.c */
|
||||
int php_com_persist_minit(INIT_FUNC_ARGS);
|
||||
@@ -150,10 +150,10 @@ PHP_FUNCTION(variant_get_type);
|
||||
PHP_FUNCTION(variant_set_type);
|
||||
PHP_FUNCTION(variant_cast);
|
||||
|
||||
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
|
||||
/* com_dotnet.c */
|
||||
PHP_FUNCTION(com_dotnet_create_instance);
|
||||
@@ -162,17 +162,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
|
||||
|
||||
/* com_misc.c */
|
||||
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
|
||||
/* com_typeinfo.c */
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC);
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
int codepage TSRMLS_DC);
|
||||
void php_com_typelibrary_dtor(void *pDest);
|
||||
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
|
||||
|
||||
@@ -2167,7 +2167,7 @@ string_copy:
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
|
||||
if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if ((Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="c:/tmp"
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
%a
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="/tmp"
|
||||
--FILE--
|
||||
@@ -13,7 +16,7 @@ open_basedir="/tmp"
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d
|
||||
|
||||
+21
-4
@@ -2035,7 +2035,7 @@ static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_date;
|
||||
@@ -2159,7 +2159,7 @@ static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *cl
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_timezone;
|
||||
@@ -2215,7 +2215,7 @@ static inline zend_object_value date_object_new_interval_ex(zend_class_entry *cl
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_interval, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_interval;
|
||||
@@ -2291,7 +2291,7 @@ static inline zend_object_value date_object_new_period_ex(zend_class_entry *clas
|
||||
}
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_period, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_period;
|
||||
@@ -3511,6 +3511,14 @@ zval *date_interval_read_property(zval *object, zval *member, int type TSRMLS_DC
|
||||
|
||||
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
|
||||
|
||||
if (!obj->initialized) {
|
||||
retval = (zend_get_std_object_handlers())->read_property(object, member, type TSRMLS_CC);
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
#define GET_VALUE_FROM_STRUCT(n,m) \
|
||||
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
|
||||
value = obj->diff->n; \
|
||||
@@ -3560,8 +3568,17 @@ void date_interval_write_property(zval *object, zval *member, zval *value TSRMLS
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
|
||||
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
|
||||
|
||||
if (!obj->initialized) {
|
||||
(zend_get_std_object_handlers())->write_property(object, member, value TSRMLS_CC);
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#define SET_VALUE_FROM_STRUCT(n,m) \
|
||||
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
|
||||
if (value->type != IS_LONG) { \
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #62500 (Segfault in DateInterval class when extended)
|
||||
--INI--
|
||||
date.timezone=GMT
|
||||
--FILE--
|
||||
<?php
|
||||
class Crasher extends DateInterval {
|
||||
public $foo;
|
||||
public function __construct($time_spec) {
|
||||
var_dump($this->foo);
|
||||
$this->foo = 3;
|
||||
var_dump($this->foo);
|
||||
var_dump($this->{2});
|
||||
parent::__construct($time_spec);
|
||||
}
|
||||
}
|
||||
try {
|
||||
$c = new Crasher('blah');
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
--EXPECTF--
|
||||
NULL
|
||||
int(3)
|
||||
|
||||
Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d
|
||||
NULL
|
||||
string(%s) "DateInterval::__construct(): Unknown or bad format (blah)"
|
||||
@@ -321,6 +321,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
xmlDoc *docp = NULL;
|
||||
xmlXPathContextPtr ctx;
|
||||
int ret;
|
||||
zval *tmp;
|
||||
|
||||
ctx = (xmlXPathContextPtr) obj->ptr;
|
||||
|
||||
@@ -329,10 +330,15 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(*retval);
|
||||
tmp = *retval;
|
||||
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
|
||||
FREE_ZVAL(tmp);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
|
||||
return FAILURE;
|
||||
}
|
||||
if (tmp != *retval) {
|
||||
FREE_ZVAL(tmp);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+5
-1
@@ -3278,7 +3278,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
|
||||
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
|
||||
if (length > 2+l1+1) {
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -3428,6 +3428,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
case M_SOF13:
|
||||
case M_SOF14:
|
||||
case M_SOF15:
|
||||
if ((itemlen - 2) < 6) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
exif_process_SOFn(Data, marker, &sof_info);
|
||||
ImageInfo->Width = sof_info.width;
|
||||
ImageInfo->Height = sof_info.height;
|
||||
|
||||
@@ -104,7 +104,7 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ
|
||||
memset(intern, 0, sizeof(struct finfo_object));
|
||||
|
||||
zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
|
||||
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor,(void *) &tmp, sizeof(zval *));
|
||||
|
||||
intern->ptr = NULL;
|
||||
|
||||
@@ -271,7 +271,7 @@ ZEND_GET_MODULE(fileinfo)
|
||||
PHP_MINFO_FUNCTION(fileinfo)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "fileinfo support", "enabled");
|
||||
php_info_print_table_row(2, "fileinfo support", "enabled");
|
||||
php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION);
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
+50
-74
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/apprentice.c 2012-04-22 19:28:57.346309536 +0800
|
||||
--- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
m->str_flags = swap4(m->str_flags);
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800
|
||||
--- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -139,10 +139,8 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -755,8 +755,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
return rv;
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -819,8 +819,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
(void)fprintf(stderr, "timestamp %s\n", buf);
|
||||
} else {
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -857,8 +857,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_swap_header(cdf_header_t *);
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -916,8 +916,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
char *p, *q;
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800
|
||||
--- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1079,8 +1079,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
-#endif
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800
|
||||
--- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1252,8 +1252,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
+
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800
|
||||
--- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1577,8 +1577,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
|
||||
/*
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -1872,11 +1872,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+ return rep_cnt;
|
||||
}
|
||||
+
|
||||
Only in libmagic.orig: funcs.c.orig
|
||||
Only in libmagic.orig: funcs.c.rej
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2253,8 +2251,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2272,8 +2270,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
int magic_errno(magic_t);
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
|
||||
@@ -29,6 +29,9 @@
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
@@ -2467,8 +2465,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
|
||||
protected const char *
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2515,8 +2513,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if ((ec = strchr(c, '\n')) != NULL)
|
||||
*ec = '\0';
|
||||
diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
--- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800
|
||||
--- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -49,7 +49,7 @@
|
||||
off_t, int *, int);
|
||||
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
@@ -2672,8 +2670,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800
|
||||
+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800
|
||||
--- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -2860,7 +2858,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1669,6 +1642,65 @@
|
||||
@@ -1669,6 +1642,42 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -2876,29 +2874,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
+
|
||||
+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
+ switch (Z_STRVAL_P(pattern)[i]) {
|
||||
+ case '?':
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '*':
|
||||
+ t[j++] = '.';
|
||||
+ t[j] = '*';
|
||||
+ break;
|
||||
+ case '.':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '\\':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '\\';
|
||||
+ break;
|
||||
+ case '(':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '(';
|
||||
+ break;
|
||||
+ case ')':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = ')';
|
||||
+ break;
|
||||
+ case '~':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '~';
|
||||
@@ -2926,7 +2901,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1825,67 +1857,163 @@
|
||||
@@ -1825,67 +1834,163 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -2937,23 +2912,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- if (ms->search.s == NULL)
|
||||
- return 0;
|
||||
-
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
l = 0;
|
||||
- l = 0;
|
||||
- rc = regcomp(&rx, m->value.s,
|
||||
- REG_EXTENDED|REG_NEWLINE|
|
||||
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
|
||||
@@ -2970,6 +2929,23 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- size_t l = ms->search.s_len - 1;
|
||||
- char c = ms->search.s[l];
|
||||
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
+ l = v = 0;
|
||||
+#if (PHP_MAJOR_VERSION < 6)
|
||||
+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -1654,29 +1654,6 @@ convert_libmagic_pattern(zval *pattern, int options)
|
||||
|
||||
for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
switch (Z_STRVAL_P(pattern)[i]) {
|
||||
case '?':
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '*':
|
||||
t[j++] = '.';
|
||||
t[j] = '*';
|
||||
break;
|
||||
case '.':
|
||||
t[j++] = '\\';
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '\\':
|
||||
t[j++] = '\\';
|
||||
t[j] = '\\';
|
||||
break;
|
||||
case '(':
|
||||
t[j++] = '\\';
|
||||
t[j] = '(';
|
||||
break;
|
||||
case ')':
|
||||
t[j++] = '\\';
|
||||
t[j] = ')';
|
||||
break;
|
||||
case '~':
|
||||
t[j++] = '\\';
|
||||
t[j] = '~';
|
||||
@@ -1873,7 +1850,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
||||
|
||||
convert_libmagic_pattern(pattern, options);
|
||||
|
||||
l = 0;
|
||||
l = v = 0;
|
||||
#if (PHP_MAJOR_VERSION < 6)
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -18,9 +18,11 @@ ksort($results);
|
||||
var_dump($results);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(6) {
|
||||
array(7) {
|
||||
["%s/resources/dir.zip"]=>
|
||||
string(15) "application/zip"
|
||||
["%s/resources/test.awk"]=>
|
||||
string(10) "text/plain"
|
||||
["%s/resources/test.bmp"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
["%s/resources/test.gif"]=>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip.. only for Windows');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
// Windows uses libfileinfo 1.0.5-dev
|
||||
// this may be causing the slightly different output from the first
|
||||
// finfo_file() call
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(10) "text/plain"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(28) "text/plain; charset=us-ascii"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
* Description: Create a new fileinfo resource.
|
||||
* Source code: ext/fileinfo/fileinfo.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
|
||||
echo "*** Testing finfo_open() : error functionality ***\n";
|
||||
|
||||
var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
|
||||
var_dump( finfo_open( array(), $magicFile ) );
|
||||
var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
|
||||
var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
|
||||
var_dump( finfo_open( 'foobar' ) );
|
||||
|
||||
var_dump( new finfo('foobar') );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_open() : error functionality ***
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
|
||||
bool(false)
|
||||
resource(%d) of type (file_info)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
BEGIN { print "START" }
|
||||
@@ -0,0 +1,90 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_init("34293864345");
|
||||
$n1 = gmp_init("23434293864345");
|
||||
|
||||
$a = array(
|
||||
array(123,45),
|
||||
array(4341,9734),
|
||||
array(23487,333),
|
||||
array(-234234,-123123),
|
||||
array(-100,-2234),
|
||||
array(345,"34587345"),
|
||||
array(345,"0"),
|
||||
array("345556456",345873),
|
||||
array("34545345556456","323432445873"),
|
||||
array($n, $n1),
|
||||
);
|
||||
|
||||
foreach ($a as $val) {
|
||||
$r = gmp_gcdext($val[0],$val[1]);
|
||||
var_dump(gmp_strval($r['g']));
|
||||
var_dump(gmp_strval($r['s']));
|
||||
var_dump(gmp_strval($r['t']));
|
||||
}
|
||||
|
||||
var_dump(gmp_gcdext($val[0],array()));
|
||||
var_dump(gmp_gcdext(array(),array()));
|
||||
var_dump(gmp_gcdext(array(),array(),1));
|
||||
var_dump(gmp_gcdext(array()));
|
||||
var_dump(gmp_gcdext());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "3"
|
||||
string(2) "41"
|
||||
string(4) "-112"
|
||||
string(1) "1"
|
||||
string(4) "-805"
|
||||
string(3) "359"
|
||||
string(1) "3"
|
||||
string(2) "32"
|
||||
string(5) "-2257"
|
||||
string(4) "3003"
|
||||
string(3) "-10"
|
||||
string(2) "19"
|
||||
string(1) "2"
|
||||
string(2) "67"
|
||||
string(2) "-3"
|
||||
string(2) "15"
|
||||
string(7) "-601519"
|
||||
string(1) "6"
|
||||
string(3) "345"
|
||||
string(1) "1"
|
||||
string(1) "0"
|
||||
string(1) "1"
|
||||
string(5) "84319"
|
||||
string(9) "-84241831"
|
||||
string(1) "1"
|
||||
string(12) "167180205823"
|
||||
string(15) "-17856272782919"
|
||||
string(3) "195"
|
||||
string(15) "-23387298979862"
|
||||
string(11) "34225091793"
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_nextprime(-1);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(0);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(-1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(100000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(array());
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime("");
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(new stdclass());
|
||||
var_dump(gmp_strval($n));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "2"
|
||||
string(1) "2"
|
||||
string(4) "-997"
|
||||
string(4) "1009"
|
||||
string(6) "100003"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
string(1) "0"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+3
-1
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* ucol_getSortKey is exception in that the key length includes the
|
||||
* NUL terminator*/
|
||||
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
|
||||
if(!key_len) {
|
||||
efree( ustr );
|
||||
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
if(!key_len) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL((char *)key, key_len, 0);
|
||||
RETURN_STRINGL((char *)key, key_len - 1, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
+64
-20
@@ -99,17 +99,46 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
|
||||
if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
|
||||
"invalid value for calendar type; it must be one of "
|
||||
"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
|
||||
"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT;
|
||||
|
||||
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
|
||||
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( pattern_str && pattern_str_len>0 ){
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength,
|
||||
pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
/* object construction -> only set global error */
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting pattern to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* resources allocated from now on */
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( timezone_str && timezone_str_len >0 ){
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
|
||||
timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if(locale_len == 0) {
|
||||
@@ -122,24 +151,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
|
||||
}
|
||||
|
||||
/* Set the calendar if passed */
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
|
||||
ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
if (calendar != UCAL_TRADITIONAL) {
|
||||
ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
|
||||
calendar, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
|
||||
ucal_close(ucal_obj);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
|
||||
": error opening calendar", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(svalue)
|
||||
{
|
||||
efree(svalue);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
|
||||
"formatter creation failed", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
if(timezone_utf16)
|
||||
{
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
|
||||
|
||||
/* Set the class variables */
|
||||
dfo->date_type = date_type;
|
||||
@@ -148,6 +177,19 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if( timezone_str && timezone_str_len > 0){
|
||||
dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
|
||||
}
|
||||
|
||||
error:
|
||||
if (svalue) {
|
||||
efree(svalue);
|
||||
}
|
||||
if (timezone_utf16) {
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
|
||||
/* free_object handles partially constructed instances fine */
|
||||
zval_dtor(return_value);
|
||||
RETVAL_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -169,6 +211,8 @@ PHP_FUNCTION( datefmt_create )
|
||||
*/
|
||||
PHP_METHOD( IntlDateFormatter, __construct )
|
||||
{
|
||||
/* return_value param is being changed, therefore we will always return
|
||||
* NULL here */
|
||||
return_value = getThis();
|
||||
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Loaded 100 of 414 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user