mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
263
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba2fe0c96b | ||
|
|
b14bfacb92 | ||
|
|
4bd28cf296 | ||
|
|
ac0f7f7342 | ||
|
|
ebbef8503f | ||
|
|
64513c8571 | ||
|
|
81f414ef23 | ||
|
|
043ac320a0 | ||
|
|
5b529bbc94 | ||
|
|
22a8ea2a0a | ||
|
|
474895915e | ||
|
|
8cfb648761 | ||
|
|
e01f88df7c | ||
|
|
09d7ffabcd | ||
|
|
7768f5e2de | ||
|
|
ed5aabe8b7 | ||
|
|
1e1695e8de | ||
|
|
37e1d7c776 | ||
|
|
2115878aaa | ||
|
|
821f13fd79 | ||
|
|
062f93c93e | ||
|
|
5cd94db8bb | ||
|
|
c3fa86867b | ||
|
|
22e8a3c347 | ||
|
|
2bd299f731 | ||
|
|
aaae3637e0 | ||
|
|
76f421dd3a | ||
|
|
9c37d95627 | ||
|
|
8b642af484 | ||
|
|
2688023c7f | ||
|
|
0be5b9e6b0 | ||
|
|
008eb1461c | ||
|
|
77bf9245d2 | ||
|
|
35e3d597f5 | ||
|
|
8b104d7893 | ||
|
|
99194d1831 | ||
|
|
e324f82d3c | ||
|
|
9510611cdd | ||
|
|
398f56dbc8 | ||
|
|
87a9fc3b85 | ||
|
|
c8e55a6fd4 | ||
|
|
01f42b836c | ||
|
|
cb981e39c2 | ||
|
|
4e39968e4d | ||
|
|
710284cbc4 | ||
|
|
fc6cbc3eaa | ||
|
|
ac4d9fd055 | ||
|
|
3e267ca91b | ||
|
|
63934ea71e | ||
|
|
a492fe213a | ||
|
|
cdf72523f3 | ||
|
|
c529e9f602 | ||
|
|
6229e42ae5 | ||
|
|
1e4273d881 | ||
|
|
8b2bfaab66 | ||
|
|
04c0497ed7 | ||
|
|
48f835efbf | ||
|
|
8b20e86491 | ||
|
|
d83a75bb00 | ||
|
|
631ed7288c | ||
|
|
ad148c5ac2 | ||
|
|
ca51458081 | ||
|
|
e2b7392b96 | ||
|
|
2885f62816 | ||
|
|
600b6277f8 | ||
|
|
6b39c81957 | ||
|
|
276d19feaa | ||
|
|
eac822e897 | ||
|
|
d20bebfe13 | ||
|
|
35f832a007 | ||
|
|
5b2c30d7e6 | ||
|
|
86aecd8801 | ||
|
|
84f565ec71 | ||
|
|
3306577797 | ||
|
|
c72c4c5271 | ||
|
|
ab5dcc83a1 | ||
|
|
869ca9b733 | ||
|
|
25ba60b147 | ||
|
|
7f4327bc24 | ||
|
|
2842aa2a07 | ||
|
|
17ed2f21cf | ||
|
|
7b8861204e | ||
|
|
6c30014600 | ||
|
|
8f5c34cd39 | ||
|
|
4072b27870 | ||
|
|
cd2912af5e | ||
|
|
47461368ca | ||
|
|
13a33f7c7b | ||
|
|
f46da1da7d | ||
|
|
077b7705af | ||
|
|
f19c94b555 | ||
|
|
615ca3c99d | ||
|
|
dfc07f038b | ||
|
|
4758164ac5 | ||
|
|
84881c654e | ||
|
|
efd0e7222b | ||
|
|
783778b9d3 | ||
|
|
7bcd55c264 | ||
|
|
1e31ac079b | ||
|
|
77c202a2e6 | ||
|
|
975d144027 | ||
|
|
2db6d8e415 | ||
|
|
b6a41ad5ba | ||
|
|
a18a11cf80 | ||
|
|
d2b47e8065 | ||
|
|
7448b03300 | ||
|
|
25f324fad7 | ||
|
|
b2622ed838 | ||
|
|
cab354debd | ||
|
|
d660d6d31b | ||
|
|
5574562f8f | ||
|
|
0643c7ab4d | ||
|
|
575f5002c0 | ||
|
|
44ba557de5 | ||
|
|
98fe858275 | ||
|
|
8e576e5abc | ||
|
|
998a2ddc37 | ||
|
|
e547c9f139 | ||
|
|
4ee9098514 | ||
|
|
c469213e7b | ||
|
|
4cd64aad8a | ||
|
|
16570b8c79 | ||
|
|
8a985403f6 | ||
|
|
eaa5b1f911 | ||
|
|
fc09d7e76f | ||
|
|
4dd1be2079 | ||
|
|
e6fb787c66 | ||
|
|
f31c4d5398 | ||
|
|
2b02e6dff3 | ||
|
|
01ea314e8c | ||
|
|
8489ecefd3 | ||
|
|
d34ab3a53c | ||
|
|
53f227bb2a | ||
|
|
76fc73cbfc | ||
|
|
9d908c70d5 | ||
|
|
cfd0979be5 | ||
|
|
9c6df8a238 | ||
|
|
cf0012dad0 | ||
|
|
8417a23973 | ||
|
|
d4cb4168ba | ||
|
|
d709922979 | ||
|
|
f1b358c9a9 | ||
|
|
d1ed6b1b15 | ||
|
|
34b9f9dedf | ||
|
|
2d660dd630 | ||
|
|
00bfc6eb49 | ||
|
|
22857f1d89 | ||
|
|
281e2f8207 | ||
|
|
7780bfc7b3 | ||
|
|
000e35db81 | ||
|
|
8a57fcdfbd | ||
|
|
020a02ef9d | ||
|
|
50949c9332 | ||
|
|
b48d2f6d10 | ||
|
|
b711a96acb | ||
|
|
033ce8f28c | ||
|
|
b7ebf90221 | ||
|
|
a83581e223 | ||
|
|
b53f326f67 | ||
|
|
60ac255897 | ||
|
|
53baf6fa1d | ||
|
|
87553b0730 | ||
|
|
634a1ff033 | ||
|
|
fd5bd37ab1 | ||
|
|
54212dfbf9 | ||
|
|
27a603e811 | ||
|
|
a8fbb15311 | ||
|
|
350082ed71 | ||
|
|
d83467d70b | ||
|
|
3c58b2c31a | ||
|
|
23ebda3a71 | ||
|
|
a827aefe47 | ||
|
|
07fb188492 | ||
|
|
858ebd9285 | ||
|
|
d5c171311d | ||
|
|
66e3912f3a | ||
|
|
d4387fca0a | ||
|
|
3af5722e11 | ||
|
|
2b033607f3 | ||
|
|
15d611e451 | ||
|
|
3f32bd9f43 | ||
|
|
fe181463a7 | ||
|
|
b53e547d85 | ||
|
|
c28a6253e5 | ||
|
|
3db7427b71 | ||
|
|
9607d15d7d | ||
|
|
97ff815cbb | ||
|
|
1ec4d3698b | ||
|
|
ea4ba9d008 | ||
|
|
c61b56ed00 | ||
|
|
74bdb8fb15 | ||
|
|
ba8818325e | ||
|
|
f6356b435a | ||
|
|
9e1113dee1 | ||
|
|
fed294d2a8 | ||
|
|
1e0499b095 | ||
|
|
4698a412bf | ||
|
|
ab9f9b5d3b | ||
|
|
a6f7760d57 | ||
|
|
dde7a05978 | ||
|
|
523f230c83 | ||
|
|
feef202718 | ||
|
|
6e300bdeae | ||
|
|
8c396e0e88 | ||
|
|
a358211a75 | ||
|
|
c904d380a2 | ||
|
|
ae1f18b69c | ||
|
|
09a19e778b | ||
|
|
1f4b057b63 | ||
|
|
32df2b6617 | ||
|
|
78c1ef2adb | ||
|
|
c6cf3d4ada | ||
|
|
0b8cfa6c78 | ||
|
|
2577cdbea2 | ||
|
|
42952a756e | ||
|
|
73cd5fca2c | ||
|
|
74ed42c169 | ||
|
|
1c98955d0f | ||
|
|
e3cf72b829 | ||
|
|
8f3c29aee1 | ||
|
|
6237bcd39e | ||
|
|
656381745a | ||
|
|
e80e38ab7c | ||
|
|
276b57316c | ||
|
|
884697a290 | ||
|
|
c28b03a8e7 | ||
|
|
ea0355632d | ||
|
|
ef04bc4a51 | ||
|
|
1b6a9ea584 | ||
|
|
7b3a2d16aa | ||
|
|
fa7c32040c | ||
|
|
08b4f3c745 | ||
|
|
500632ac13 | ||
|
|
c0abab5fca | ||
|
|
202989edf8 | ||
|
|
40ff001381 | ||
|
|
ae837db8cf | ||
|
|
39974dd65d | ||
|
|
846e8a3ec9 | ||
|
|
fa7c23ba27 | ||
|
|
acb9426a6b | ||
|
|
8bdf9905da | ||
|
|
1a50a50bcf | ||
|
|
fd5644cd0b | ||
|
|
0255c21319 | ||
|
|
a468752e53 | ||
|
|
114e5d0206 | ||
|
|
26dda8999c | ||
|
|
94e9d0a2ae | ||
|
|
0674d677bc | ||
|
|
372bf8a923 | ||
|
|
4800a95e72 | ||
|
|
da0ed5cdb1 | ||
|
|
34ab10ef1b | ||
|
|
da5db1c9b2 | ||
|
|
0b5466c0a6 | ||
|
|
8a3f45f90b | ||
|
|
a93dba4324 | ||
|
|
17164bcf8d | ||
|
|
528bc00d84 | ||
|
|
2cc8cf2994 | ||
|
|
5dd2a4185c | ||
|
|
1f0ea7fa4d |
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.0
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.3
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
@@ -171,7 +171,7 @@ define ____printzv_contents
|
||||
printf "UNDEF"
|
||||
end
|
||||
if $type == 1
|
||||
printf "NULL"
|
||||
printf "NULL"
|
||||
end
|
||||
if $type == 2
|
||||
printf "bool: false"
|
||||
@@ -179,15 +179,15 @@ define ____printzv_contents
|
||||
if $type == 3
|
||||
printf "bool: true"
|
||||
end
|
||||
if $type == 4
|
||||
if $type == 4
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 7
|
||||
printf "array: "
|
||||
if ! $arg1
|
||||
@@ -245,25 +245,31 @@ define ____printzv_contents
|
||||
printf "const: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 12
|
||||
printf "const_ast"
|
||||
printf "CONSTANT_AST"
|
||||
end
|
||||
if $type == 13
|
||||
printf "_IS_BOOL"
|
||||
printf "_BOOL"
|
||||
end
|
||||
if $type == 14
|
||||
printf "IS_CALLABLE"
|
||||
printf "CALLABLE"
|
||||
end
|
||||
if $type == 15
|
||||
printf "indirect: "
|
||||
____printzv $zvalue->value.zv $arg1
|
||||
end
|
||||
if $type == 16
|
||||
printf "string_offset"
|
||||
end
|
||||
if $type == 17
|
||||
printf "pointer: %p", $zvalue->value.ptr
|
||||
end
|
||||
if $type > 17
|
||||
if $type == 18
|
||||
printf "ITERABLE"
|
||||
end
|
||||
if $type == 19
|
||||
printf "VOID"
|
||||
end
|
||||
if $type == 20
|
||||
printf "_ERROR"
|
||||
end
|
||||
if $type == 16 || $type > 20
|
||||
printf "unknown type %d", $type
|
||||
end
|
||||
printf "\n"
|
||||
@@ -283,38 +289,18 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define ____print_const_table
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $const = (zend_constant *) $p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
____printzv_contents &$const->value 0
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
____print_const_table $arg0
|
||||
____print_ht $arg0 4
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_const_table
|
||||
Dumps elements of Constants HashTable
|
||||
Example: print_const_table executor_globals.zend_constants
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $n = $ind
|
||||
@@ -361,6 +347,10 @@ define ____print_ht
|
||||
set $func = (zend_function*)$p->val.value.ptr
|
||||
printf "\"%s\"\n", $func->common.function_name->val
|
||||
end
|
||||
if $arg1 == 4
|
||||
set $const = (zend_constant *)$p->val.value.ptr
|
||||
____printzv $const 1
|
||||
end
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
|
||||
@@ -1,6 +1,111 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
15 Feb 2018, PHP 7.2.3RC1
|
||||
26 Apr 2018, PHP 7.2.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75722 (Convert valgrind detection to configure option).
|
||||
(Michael Heimpold)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #76131 (mismatch arginfo for date_create). (carusogabriel)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug#76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
|
||||
(Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #68440 (ERROR: failed to reload: execvp() failed: Argument list
|
||||
too long). (Jacob Hipps)
|
||||
. Fixed incorrect write to getenv result in FPM reload. (Jakub Zelenka)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #52070 (imagedashedline() - dashed line sometimes is not visible).
|
||||
(cmb)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76153 (Intl compilation fails with icu4c 61.1). (Anatol)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #76249 (stream filter convert.iconv leads to infinite loop on
|
||||
invalid sequence). (Stas)
|
||||
|
||||
- ldap:
|
||||
. Fixed bug #76248 (Malicious LDAP-Server Response causes Crash). (Stas)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
|
||||
. Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
|
||||
(chrullrich, cmb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #76088 (ODBC functions are not available by default on Windows).
|
||||
(cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76094 (Access violation when using opcache). (Laruence)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76129 (fix for CVE-2018-5712 may not be complete). (Stas)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76143 (Memory corruption: arbitrary NUL overwrite). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #76131 (mismatch arginfo for splarray constructor).
|
||||
(carusogabriel)
|
||||
|
||||
- standard:
|
||||
. Fixed bug #74139 (mail.add_x_header default inconsistent with docs). (cmb)
|
||||
. Fixed bug #75996 (incorrect url in header for mt_rand). (tatarbj)
|
||||
|
||||
29 Mar 2018, PHP 7.2.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76025 (Segfault while throwing exception in error_handler).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #76044 ('date: illegal option -- -' in ./configure on FreeBSD).
|
||||
(Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #75605 (Dumpable FPM child processes allow bypassing opcache
|
||||
access controls). (Jakub Zelenka)
|
||||
|
||||
- FTP:
|
||||
. Fixed ftp_pasv arginfo. (carusogabriel)
|
||||
|
||||
-GD:
|
||||
. Fixed bug #73957 (signed integer conversion in imagescale()). (cmb)
|
||||
. Fixed bug #76041 (null pointer access crashed php). (cmb)
|
||||
. Fixed imagesetinterpolation arginfo. (Gabriel Caruso)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #75867 (Freeing uninitialized pointer). (Philip Prindeville)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #62545 (wrong unicode mapping in some charsets). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75969 (Assertion failure in live range DCE due to block pass
|
||||
misoptimization). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed openssl_* arginfos. (carusogabriel)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #75873 (pcntl_wexitstatus returns incorrect on Big_Endian platform
|
||||
(s390x)). (Sam Ding)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76085 (Segmentation fault in buildFromIterator when directory
|
||||
name contains a \n). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75961 (Strange references behavior). (Laruence)
|
||||
. Fixed some arginfos. (carusogabriel)
|
||||
. Fixed bug #76068 (parse_ini_string fails to parse "[foo]\nbar=1|>baz" with
|
||||
segfault). (Anatol)
|
||||
|
||||
01 Mar 2018, PHP 7.2.3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75864 ("stream_isatty" returns wrong value on s390x). (Sam Ding)
|
||||
@@ -48,6 +153,8 @@ PHP NEWS
|
||||
- Standard:
|
||||
. Fixed bug #75916 (DNS_CAA record results contain garbage). (Mike,
|
||||
Philip Sharp)
|
||||
. Fixed bug #75981 (Prevent reading beyond buffer start in http wrapper).
|
||||
(Stas)
|
||||
|
||||
01 Feb 2018, PHP 7.2.2
|
||||
|
||||
@@ -273,8 +380,6 @@ PHP NEWS
|
||||
DateTimeInterface interface). (Majkl578)
|
||||
. Fixed bug #75149 (redefinition of typedefs ttinfo and t1info). (Remi)
|
||||
. Fixed bug #75222 (DateInterval microseconds property always 0). (jhdxr)
|
||||
. Fixed bug #68406 (calling var_dump on a DateTimeZone object modifies it).
|
||||
(jhdxr)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #72885 (flatfile: dba_fetch() fails to read replaced entry).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Win32 Build System.
|
||||
|
||||
See http://wiki.php.net/internals/windows/stepbystepbuild
|
||||
See https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
|
||||
|
||||
vim:tw=78:sw=1:ts=1:et
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?>
|
||||
<?php if (!function_exists('memory_get_usage')) die('skip memory_get_usage() not installed'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76025 (Segfault while throwing exception in error_handler)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function handleError($errno, $errstr, $errfile, $errline) {
|
||||
$exception = new exception("blah");
|
||||
throw $exception;
|
||||
}
|
||||
set_error_handler('handleError', E_ALL);
|
||||
$c = $b[$a];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: blah in %sbug76025.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug76025.php on line %d
|
||||
+4
-3
@@ -245,9 +245,10 @@ static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, zend_free_
|
||||
|
||||
static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
}
|
||||
}
|
||||
|
||||
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
|
||||
|
||||
+1
-1
@@ -1764,7 +1764,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
|
||||
GC_TYPE_INFO(target) = IS_ARRAY | (GC_COLLECTABLE << GC_FLAGS_SHIFT);
|
||||
|
||||
target->nTableSize = source->nTableSize;
|
||||
target->pDestructor = source->pDestructor;
|
||||
target->pDestructor = ZVAL_PTR_DTOR;
|
||||
|
||||
if (source->nNumUsed == 0) {
|
||||
target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
|
||||
|
||||
+12
-4
@@ -57,11 +57,19 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
if (IS_LONG == Z_TYPE_P(op1)) {
|
||||
i_op1 = Z_LVAL_P(op1);
|
||||
} else {
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
}
|
||||
if (op2) {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
if (IS_LONG == Z_TYPE_P(op2)) {
|
||||
i_op2 = Z_LVAL_P(op2);
|
||||
} else {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
}
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
@@ -69301,7 +69301,7 @@ ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
|
||||
LOAD_OPLINE();
|
||||
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
|
||||
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
|
||||
handler = (opcode_handler_t)zend_vm_get_opcode_handler_func(opline->opcode, opline);
|
||||
handler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->opcode], opline);
|
||||
handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
if (EXPECTED(opline != &hybrid_halt_op)) {
|
||||
#else
|
||||
|
||||
@@ -2599,7 +2599,7 @@ function gen_vm($def, $skel) {
|
||||
out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
|
||||
if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
|
||||
out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
|
||||
out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(opline->opcode, opline);\n");
|
||||
out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->opcode], opline);\n");
|
||||
out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
|
||||
out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
|
||||
out($f,"#else\n");
|
||||
|
||||
+3
-20
@@ -2237,6 +2237,9 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -3249,23 +3252,3 @@ AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
|
||||
|
||||
dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
|
||||
m4_include([build/ax_check_compile_flag.m4])
|
||||
|
||||
dnl PHP_CHECK_VALGRIND
|
||||
AC_DEFUN([PHP_CHECK_VALGRIND], [
|
||||
AC_MSG_CHECKING([for valgrind])
|
||||
|
||||
SEARCH_PATH="/usr/local /usr"
|
||||
SEARCH_FOR="/include/valgrind/valgrind.h"
|
||||
for i in $SEARCH_PATH ; do
|
||||
if test -r $i/$SEARCH_FOR; then
|
||||
VALGRIND_DIR=$i
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$VALGRIND_DIR"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
else
|
||||
AC_MSG_RESULT(found in $VALGRIND_DIR)
|
||||
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
|
||||
fi
|
||||
])
|
||||
+35
-4
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=3
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=5
|
||||
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`
|
||||
|
||||
@@ -753,7 +753,35 @@ if test "x$php_crypt_r" = "x1"; then
|
||||
PHP_CRYPT_R_STYLE
|
||||
fi
|
||||
|
||||
PHP_CHECK_VALGRIND
|
||||
dnl Check valgrind support
|
||||
PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
|
||||
[ --with-valgrind=DIR Enable valgrind support], yes, no)
|
||||
|
||||
if test "$PHP_VALGRIND" != "no"; then
|
||||
|
||||
AC_MSG_CHECKING([for valgrind header])
|
||||
|
||||
if test "$PHP_VALGRIND" = "yes"; then
|
||||
SEARCH_PATH="/usr/local /usr"
|
||||
else
|
||||
SEARCH_PATH="$PHP_VALGRIND"
|
||||
fi
|
||||
|
||||
SEARCH_FOR="/include/valgrind/valgrind.h"
|
||||
for i in $SEARCH_PATH ; do
|
||||
if test -r $i/$SEARCH_FOR; then
|
||||
VALGRIND_DIR=$i
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$VALGRIND_DIR"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
else
|
||||
AC_MSG_RESULT(found in $VALGRIND_DIR)
|
||||
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
dnl General settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -1269,7 +1297,10 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
|
||||
|
||||
# SOURCE_DATE_EPOCH for reproducible builds https://reproducible-builds.org/specs/source-date-epoch/
|
||||
PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
|
||||
if test $? -ne 0 ; then
|
||||
PHP_BUILD_DATE=`date -u +%Y-%m-%d`
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
|
||||
|
||||
PHP_UNAME=`uname -a | xargs`
|
||||
|
||||
@@ -1012,13 +1012,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
|
||||
tzset();
|
||||
ttstamp = timestamp;
|
||||
tmv = localtime(&ttstamp);
|
||||
#if ZEND_ENABLE_ZVAL_LONG64
|
||||
|
||||
/* Invalid after 23:59:59, December 31, 3000, UTC */
|
||||
if (!tmv) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&systime, 0, sizeof(systime));
|
||||
|
||||
systime.wDay = tmv->tm_mday;
|
||||
|
||||
@@ -3,7 +3,6 @@ Bug #72498 variant_date_from_timestamp null dereference
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
|
||||
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
+796
-791
File diff suppressed because it is too large.
Load diff
+32
-45
@@ -162,7 +162,7 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, time)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_ARG_INFO(0, timezone)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
|
||||
@@ -657,6 +657,7 @@ static HashTable *date_object_get_properties_period(zval *object);
|
||||
static HashTable *date_object_get_properties_timezone(zval *object);
|
||||
static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n);
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp);
|
||||
static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
|
||||
@@ -2041,9 +2042,9 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
@@ -2061,7 +2062,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2399,6 +2400,30 @@ static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
|
||||
return props;
|
||||
} /* }}} */
|
||||
|
||||
static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv)
|
||||
{
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
ZVAL_STRING(zv, tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
timelib_sll utc_offset = tzobj->tzi.utc_offset;
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
utc_offset < 0 ? '-' : '+',
|
||||
abs(utc_offset / 3600),
|
||||
abs(((utc_offset % 3600) / 60)));
|
||||
|
||||
ZVAL_NEW_STR(zv, tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
ZVAL_STRING(zv, tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp) /* {{{ */
|
||||
{
|
||||
HashTable *ht, *props;
|
||||
@@ -2410,29 +2435,11 @@ static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp
|
||||
|
||||
*is_temp = 1;
|
||||
ht = zend_array_dup(props);
|
||||
|
||||
|
||||
ZVAL_LONG(&zv, tzobj->type);
|
||||
zend_hash_str_update(ht, "timezone_type", sizeof("timezone_type")-1, &zv);
|
||||
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
ZVAL_STRING(&zv, tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
tzobj->tzi.utc_offset < 0 ? '-' : '+',
|
||||
abs((int)(tzobj->tzi.utc_offset / 3600)),
|
||||
abs(((int)(tzobj->tzi.utc_offset % 3600) / 60)));
|
||||
|
||||
ZVAL_NEW_STR(&zv, tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
ZVAL_STRING(&zv, tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
php_timezone_to_string(tzobj, &zv);
|
||||
zend_hash_str_update(ht, "timezone", sizeof("timezone")-1, &zv);
|
||||
|
||||
return ht;
|
||||
@@ -3942,27 +3949,7 @@ PHP_FUNCTION(timezone_name_get)
|
||||
}
|
||||
tzobj = Z_PHPTIMEZONE_P(object);
|
||||
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
|
||||
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
RETURN_STRING(tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
timelib_sll utc_offset = tzobj->tzi.utc_offset;
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
utc_offset < 0 ? '-' : '+',
|
||||
abs(utc_offset / 3600),
|
||||
abs(((utc_offset % 3600) / 60)));
|
||||
|
||||
RETURN_NEW_STR(tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
RETURN_STRING(tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
php_timezone_to_string(tzobj, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -598,7 +598,6 @@ PHP_MINIT_FUNCTION(dom)
|
||||
memcpy(&dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
dom_object_handlers.offset = XtOffsetOf(dom_object, std);
|
||||
dom_object_handlers.free_obj = dom_objects_free_storage;
|
||||
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
|
||||
dom_object_handlers.read_property = dom_read_property;
|
||||
dom_object_handlers.write_property = dom_write_property;
|
||||
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
|
||||
|
||||
+1
-1
@@ -2112,7 +2112,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, (int) strlen(value));
|
||||
length = (int) php_strnlen(value, length);
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value)
|
||||
--DESCRIPTION--
|
||||
This test is meant to exhibit memory issues with the `-m` option. Since a lot of
|
||||
notices and warnings are to be expected anyway, we suppress these, since the are
|
||||
not relevant for this test.
|
||||
--INI--
|
||||
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76130_1.jpg');
|
||||
exif_read_data(__DIR__ . '/bug76130_2.jpg');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -127,6 +127,24 @@ dnl [ --enable-$extname Enable $extname support])
|
||||
if test "\$PHP_$EXTNAME" != "no"; then
|
||||
dnl Write more examples of tests here...
|
||||
|
||||
dnl # get library FOO build options from pkg-config output
|
||||
dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
dnl AC_MSG_CHECKING(for libfoo)
|
||||
dnl if test -x "\$PKG_CONFIG" && \$PKG_CONFIG --exists foo; then
|
||||
dnl if \$PKG_CONFIG foo --atleast-version 1.2.3; then
|
||||
dnl LIBFOO_CFLAGS=\`\$PKG_CONFIG foo --cflags\`
|
||||
dnl LIBFOO_LIBDIR=\`\$PKG_CONFIG foo --libs\`
|
||||
dnl LIBFOO_VERSON=\`\$PKG_CONFIG foo --modversion\`
|
||||
dnl AC_MSG_RESULT(from pkgconfig: version \$LIBFOO_VERSON)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
|
||||
dnl fi
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR(pkg-config not found)
|
||||
dnl fi
|
||||
dnl PHP_EVAL_LIBLINE(\$LIBFOO_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl PHP_EVAL_INCLINE(\$LIBFOO_CFLAGS)
|
||||
|
||||
dnl # --with-$extname -> check with-path
|
||||
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
|
||||
dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, resumepos)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_ftp_pasv, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_pasv, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, ftp)
|
||||
ZEND_ARG_INFO(0, pasv)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -7,7 +7,7 @@ if (2147483647 == PHP_INT_MAX) {
|
||||
die('skip ot supported on this system');
|
||||
}
|
||||
if (disk_free_space(__DIR__) < 10*1024*1024*1024) {
|
||||
die('not enough disk space');
|
||||
die('skip Not enough disk space');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
+2
-2
@@ -848,7 +848,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_imageaffinematrixconcat, 0)
|
||||
ZEND_ARG_INFO(0, m2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_imagesetinterpolation, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagesetinterpolation, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, im)
|
||||
ZEND_ARG_INFO(0, method)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -4842,7 +4842,7 @@ PHP_FUNCTION(imagescale)
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_h <= 0 || tmp_w <= 0) {
|
||||
if (tmp_h <= 0 || tmp_h > INT_MAX || tmp_w <= 0 || tmp_w > INT_MAX) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -1239,6 +1239,12 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
|
||||
long x, y, inc, frac;
|
||||
long dx, dy,tmp;
|
||||
|
||||
if (!im->trueColor) {
|
||||
/* TBB: don't crash when the image is of the wrong type */
|
||||
gdImageLine(im, x1, y1, x2, y2, col);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
|
||||
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
|
||||
return;
|
||||
@@ -1332,7 +1338,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color
|
||||
} else {
|
||||
wid = 1;
|
||||
}
|
||||
wid = (int)(thick * sin(atan2(dy, dx)));
|
||||
vert = 1;
|
||||
|
||||
d = 2 * dy - dx;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(1200, 800);
|
||||
$background_color = imagecolorallocate($im, 40, 40, 40);
|
||||
$color = imagecolorallocate($im, 255, 255, 255);
|
||||
imagedashedline($im, 800, 400, 300, 400, $color);
|
||||
imagedashedline($im, 800, 400, 300, 800, $color);
|
||||
imagedashedline($im, 800, 400, 400, 800, $color);
|
||||
imagedashedline($im, 800, 400, 500, 800, $color);
|
||||
imagedashedline($im, 800, 400, 600, 800, $color);
|
||||
imagedashedline($im, 800, 400, 700, 800, $color);
|
||||
imagedashedline($im, 800, 400, 800, 800, $color);
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug52070.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73957 (signed integer conversion in imagescale())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(8, 8);
|
||||
$im = imagescale($im, 0x100000001, 1);
|
||||
var_dump($im);
|
||||
if ($im) { // which is not supposed to happen
|
||||
var_dump(imagesx($im));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #76041 (null pointer access crashed php)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im=imagecreate(100, 100);
|
||||
imageantialias($im, true);
|
||||
imageline($im, 0, 0, 10, 10, 0xffffff);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+2
-2
@@ -1965,8 +1965,8 @@ ZEND_FUNCTION(gmp_setbit)
|
||||
php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX ) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %ld * %ld", INT_MAX, GMP_NUMB_BITS);
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %d * %d", INT_MAX, GMP_NUMB_BITS);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2642,6 +2642,9 @@ static int php_iconv_stream_filter_append_bucket(
|
||||
tcnt = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
|
||||
goto out_failure;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fh = fopen('php://memory', 'rw');
|
||||
fwrite($fh, "abc");
|
||||
rewind($fh);
|
||||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, []);
|
||||
$a = stream_get_contents($fh);
|
||||
var_dump(strlen($a));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
|
||||
int(3)
|
||||
DONE
|
||||
+21
-12
@@ -9,6 +9,7 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_SETUP_ICU(INTL_SHARED_LIBADD)
|
||||
PHP_SUBST(INTL_SHARED_LIBADD)
|
||||
PHP_REQUIRE_CXX()
|
||||
INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
|
||||
if test "$icu_version" -ge "4002"; then
|
||||
icu_spoof_src=" spoofchecker/spoofchecker_class.c \
|
||||
spoofchecker/spoofchecker.c\
|
||||
@@ -20,7 +21,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_NEW_EXTENSION(intl, php_intl.c \
|
||||
intl_error.c \
|
||||
intl_convert.c \
|
||||
intl_convertcpp.cpp \
|
||||
collator/collator.c \
|
||||
collator/collator_class.c \
|
||||
collator/collator_sort.c \
|
||||
@@ -32,8 +32,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
collator/collator_is_numeric.c \
|
||||
collator/collator_error.c \
|
||||
common/common_error.c \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
converter/converter.c \
|
||||
formatter/formatter.c \
|
||||
formatter/formatter_main.c \
|
||||
@@ -53,17 +51,12 @@ if test "$PHP_INTL" != "no"; then
|
||||
dateformat/dateformat_attr.c \
|
||||
dateformat/dateformat_data.c \
|
||||
dateformat/dateformat_format.c \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_parse.c \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat.c \
|
||||
msgformat/msgformat_attr.c \
|
||||
msgformat/msgformat_class.c \
|
||||
msgformat/msgformat_data.c \
|
||||
msgformat/msgformat_format.c \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
msgformat/msgformat_parse.c \
|
||||
grapheme/grapheme_string.c \
|
||||
grapheme/grapheme_util.c \
|
||||
@@ -73,6 +66,18 @@ if test "$PHP_INTL" != "no"; then
|
||||
transliterator/transliterator.c \
|
||||
transliterator/transliterator_class.c \
|
||||
transliterator/transliterator_methods.c \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
|
||||
|
||||
PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
timezone/timezone_class.cpp \
|
||||
timezone/timezone_methods.cpp \
|
||||
calendar/calendar_class.cpp \
|
||||
@@ -83,10 +88,14 @@ if test "$PHP_INTL" != "no"; then
|
||||
breakiterator/breakiterator_methods.cpp \
|
||||
breakiterator/rulebasedbreakiterator_methods.cpp \
|
||||
breakiterator/codepointiterator_internal.cpp \
|
||||
breakiterator/codepointiterator_methods.cpp \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
|
||||
breakiterator/codepointiterator_methods.cpp"
|
||||
PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
|
||||
if test "$ext_shared" = "no"; then
|
||||
PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
|
||||
else
|
||||
PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS, shared_objects_intl, yes)
|
||||
fi
|
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/collator)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/converter)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/common)
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ if (PHP_INTL != "no") {
|
||||
ADD_FLAG("LIBS_INTL", "iculx.lib");
|
||||
}
|
||||
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc");
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc /D U_USING_ICU_NAMESPACE=1");
|
||||
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
|
||||
} else {
|
||||
WARNING("intl not enabled; libraries and/or headers not found");
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
*/
|
||||
PHP_METHOD(Spoofchecker, __construct)
|
||||
{
|
||||
#if U_ICU_VERSION_MAJOR_NUM < 58
|
||||
int checks;
|
||||
#endif
|
||||
zend_error_handling error_handling;
|
||||
SPOOFCHECKER_METHOD_INIT_VARS;
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 56.1
|
||||
numfmt_format() icu >= 56.1 && icu < 61.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '56.1') < 0) die('skip for ICU >= 56.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 61.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Format a number using misc locales/patterns.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
|
||||
* currency and percent formatting.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$styles = array(
|
||||
NumberFormatter::PATTERN_DECIMAL => '##.#####################',
|
||||
NumberFormatter::DECIMAL => '',
|
||||
NumberFormatter::CURRENCY => '',
|
||||
NumberFormatter::PERCENT => '',
|
||||
NumberFormatter::SCIENTIFIC => '',
|
||||
NumberFormatter::SPELLOUT => '@@@@@@@',
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
NumberFormatter::PATTERN_RULEBASED => '#####.###',
|
||||
1234999, // bad one
|
||||
);
|
||||
|
||||
$integer = array(
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
);
|
||||
$locales = array(
|
||||
'en_US',
|
||||
'ru_UA',
|
||||
'de',
|
||||
'fr',
|
||||
'en_UK'
|
||||
);
|
||||
|
||||
$str_res = '';
|
||||
$number = 1234567.891234567890000;
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$str_res .= "\nLocale is: $locale\n";
|
||||
foreach( $styles as $style => $pattern )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, $style, $pattern );
|
||||
|
||||
if(!$fmt) {
|
||||
$str_res .= "Bad formatter!\n";
|
||||
continue;
|
||||
}
|
||||
$str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
|
||||
}
|
||||
}
|
||||
return $str_res;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Locale is: en_US
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'\$1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'USD1,234,567.89'
|
||||
|
||||
Locale is: ru_UA
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ?(грн\.|₴)'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь целых восемьдесят девять миллионов сто двадцать три тысячи четыреста пятьдесят семь стомиллионных'
|
||||
'1 234 567.?'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 UAH'
|
||||
|
||||
Locale is: de
|
||||
'1234567.8912345\d+'
|
||||
'1.234.567,891'
|
||||
'(¤ )?1.234.567,89( ¤)?'
|
||||
'123\.456\.789 %'
|
||||
'1.2345678912345\d+E6'
|
||||
'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf( sechs)? sieben( neun)?'
|
||||
'1.234.567.?'
|
||||
'1.234.567'
|
||||
'#####.###'
|
||||
'1.234.567,89 ¤¤'
|
||||
|
||||
Locale is: fr
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ¤'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?'
|
||||
'1 234 567e'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 ¤¤'
|
||||
|
||||
Locale is: en_UK
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'¤1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'¤¤1,234,567.89'
|
||||
@@ -2,6 +2,7 @@
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
$br = $rbbi->getBinaryRules();
|
||||
|
||||
$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
|
||||
|
||||
var_dump($rbbi->getRules(), $rbbi2->getRules());
|
||||
var_dump($rbbi->getRules() == $rbbi2->getRules());
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -1,9 +1,8 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -29,4 +28,4 @@ var_dump($rbbi->getRules());
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(128) "$LN = [[:letter:] [:number:]];$S = [.;,:];!!forward;$LN+ {1};$S+ {42};!!reverse;$LN+ {1};$S+ {42};!!safe_forward;!!safe_reverse;"
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump($rbbi->getRules());
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
==DONE==
|
||||
+5
-1
@@ -1242,7 +1242,11 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
|
||||
add_assoc_long(&tmp1, "count", num_attrib);
|
||||
dn = ldap_get_dn(ldap, ldap_result_entry);
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
if (dn) {
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
} else {
|
||||
add_assoc_null(&tmp1, "dn");
|
||||
}
|
||||
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
|
||||
ldap_memfree(dn);
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76248 (Malicious LDAP-Server Response causes Crash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!function_exists('pcntl_fork')) die('skip fork not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pid = pcntl_fork();
|
||||
const PORT = 12345;
|
||||
if ($pid == 0) {
|
||||
// child
|
||||
$server = stream_socket_server("tcp://127.0.0.1:12345");
|
||||
$socket = stream_socket_accept($server, 3);
|
||||
fwrite($socket, base64_decode("MAwCAQFhBwoBAAQABAAweQIBAmR0BJljbj1yb290LGRjPWV4YW1wbGUsZGM9Y29tMFcwIwQLb2JqZWN0Q2xhc3MxFAQSb3JnYW5pemF0aW9uYWxSb2xlMAwEAmNuMQYEBHJvb3QwIgQLZGVzY3JpcHRpb24xEwQRRGlyZWN0b3J5IE1hbmFnZXIwDAIBAmUHCgEABAAEADB5AgEDZHQEmWNuPXJvb3QsZGM9ZXhhbXBsZSxkYz1jb20wVzAjBAtvYmplY3RDbGFzczEUBBJvcmdhbml6YXRpb25hbFJvbGUwDAQCY24xBgQEcm9vdDAiBAtkZXNjcmlwdGlvbjETBBFEaXJlY3RvcnkgTWFuYWdlcjAMAgEDZQcKAQAEAAQA"));
|
||||
fflush($socket);
|
||||
} else {
|
||||
// parent
|
||||
$ds = ldap_connect("127.0.0.1", PORT);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$b = ldap_bind($ds, "cn=root,dc=example,dc=com", "secret");
|
||||
|
||||
$s = ldap_search($ds, "dc=example,dc=com", "(cn=root)");
|
||||
$tt = ldap_get_entries($ds, $s);
|
||||
var_dump($tt);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
["dn"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter)
|
||||
/* all of this is so ugly now! */
|
||||
static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter)
|
||||
{
|
||||
if (c >= 0x80 && c < 0xff)
|
||||
if (c >= 0x80 && c <= 0xff)
|
||||
filter->flag = 0;
|
||||
else
|
||||
filter->flag = 1; /* not it */
|
||||
|
||||
@@ -30,7 +30,7 @@ static const unsigned short cp1251_ucs_table[] = {
|
||||
0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021,
|
||||
0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f,
|
||||
0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
|
||||
0x003f, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0xfffd, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7,
|
||||
0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407,
|
||||
0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7,
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
* as it only covers this range, while the rest cover 0xa0 onwards */
|
||||
|
||||
static const unsigned short cp1252_ucs_table[] = {
|
||||
0x20ac,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0x017d,0xfffe,
|
||||
0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffe,0x017e,0x0178
|
||||
0x20ac,0xfffd,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffd,0x017d,0xfffd,
|
||||
0xfffd,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffd,0x017e,0x0178
|
||||
};
|
||||
#endif /* UNICODE_TABLE_CP1252_H */
|
||||
@@ -449,7 +449,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
|
||||
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||
|
||||
rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
|
||||
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
|
||||
if (!rc || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
|
||||
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
|
||||
onig_error_code_to_str(err_str, err_code, &err_info);
|
||||
php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #62545 (wrong unicode mapping in some charsets)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
bin2hex(mb_convert_encoding("\x98", 'UTF-8', 'Windows-1251')),
|
||||
bin2hex(mb_convert_encoding("\x81\x8d\x8f\x90\x9d", 'UTF-8', 'Windows-1252'))
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(6) "efbfbd"
|
||||
string(30) "efbfbdefbfbdefbfbdefbfbdefbfbd"
|
||||
===DONE===
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
|
||||
var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
|
||||
?>
|
||||
--EXPECT--
|
||||
string(12) "Windows-1251"
|
||||
string(12) "Windows-1251"
|
||||
|
||||
@@ -8,10 +8,10 @@ mysqli autocommit/commit/rollback
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
die(sprintf("Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -94,4 +94,4 @@ array(2) {
|
||||
[1]=>
|
||||
string(4) "egon"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -12,7 +12,7 @@ require_once __DIR__ . '/skipif.inc';
|
||||
require_once __DIR__ . '/skipifconnectfailure.inc';
|
||||
require_once __DIR__ . '/connect.inc';
|
||||
if (!$IS_MYSQLND) {
|
||||
die('mysqlnd only');
|
||||
die('skip mysqlnd only');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -79,11 +79,15 @@ mysqlnd_run_authentication(
|
||||
struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol);
|
||||
|
||||
if (!auth_plugin) {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
if (first_call) {
|
||||
mnd_pefree(requested_protocol, FALSE);
|
||||
requested_protocol = mnd_pestrdup(MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
DBG_INF("plugin found");
|
||||
|
||||
{
|
||||
zend_uchar * switch_to_auth_protocol_data = NULL;
|
||||
@@ -108,10 +112,13 @@ mysqlnd_run_authentication(
|
||||
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
|
||||
/* The data should be allocated with malloc() */
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
if (auth_plugin) {
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
}
|
||||
|
||||
if (conn->error_info->error_no) {
|
||||
goto end;
|
||||
}
|
||||
@@ -780,7 +787,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data);
|
||||
|
||||
|
||||
if (conn->protocol_frame_codec->data->ssl) {
|
||||
if (conn->vio->data->ssl) {
|
||||
DBG_INF("simple clear text under SSL");
|
||||
/* clear text under SSL */
|
||||
*auth_data_len = passwd_len;
|
||||
|
||||
@@ -514,6 +514,7 @@ MYSQLND_METHOD(mysqlnd_vio, enable_ssl)(MYSQLND_VIO * const net)
|
||||
zval cafile_zval;
|
||||
ZVAL_STRING(&cafile_zval, net->data->options.ssl_ca);
|
||||
php_stream_context_set_option(context, "ssl", "cafile", &cafile_zval);
|
||||
zval_ptr_dtor(&cafile_zval);
|
||||
any_flag = TRUE;
|
||||
}
|
||||
if (net->data->options.ssl_capath) {
|
||||
|
||||
@@ -870,8 +870,6 @@ optimize_const_unary_op:
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
|
||||
strip_nops(op_array, block);
|
||||
}
|
||||
|
||||
/* Rebuild plain (optimized) op_array from CFG */
|
||||
@@ -1934,6 +1932,13 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
|
||||
zend_optimize_block(b, op_array, usage, &cfg, Tsource);
|
||||
}
|
||||
|
||||
/* Eliminate NOPs */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
strip_nops(op_array, b);
|
||||
}
|
||||
}
|
||||
|
||||
/* Jump optimization for each block */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
|
||||
@@ -356,7 +356,8 @@ static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
|
||||
|
||||
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) {
|
||||
if (!try_remove_var_def(ctx, ssa_op->op1_use, ssa_op->op1_use_chain, opline)) {
|
||||
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
|
||||
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)
|
||||
&& opline->opcode != ZEND_CASE) {
|
||||
free_var = ssa_op->op1_use;
|
||||
free_var_type = opline->op1_type;
|
||||
}
|
||||
|
||||
@@ -820,7 +820,8 @@ static inline int ct_eval_func_call(
|
||||
} else if (zend_string_equals_literal(name, "substr")) {
|
||||
if (Z_TYPE_P(args[0]) != IS_STRING
|
||||
|| Z_TYPE_P(args[1]) != IS_LONG
|
||||
|| Z_TYPE_P(args[2]) != IS_LONG) {
|
||||
|| Z_TYPE_P(args[2]) != IS_LONG
|
||||
|| (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* pass */
|
||||
|
||||
@@ -240,7 +240,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("is_subclass_of", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
|
||||
F0("is_a", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
|
||||
F1("get_class_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
FN("get_object_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
FN("get_object_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
F1("get_class_methods", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F0("method_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F0("property_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
@@ -268,8 +268,8 @@ static const func_info_t func_infos[] = {
|
||||
FC("extension_loaded", zend_b_s_info),
|
||||
F1("get_extension_funcs", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
|
||||
/* ext/statdard */
|
||||
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE),
|
||||
/* ext/standard */
|
||||
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("bin2hex", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hex2bin", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F0("sleep", MAY_BE_FALSE | MAY_BE_LONG),
|
||||
@@ -696,7 +696,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("fnmatch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
#endif
|
||||
F1("fsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
FN("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("pack", MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("unpack", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("get_browser", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_OBJECT | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
|
||||
@@ -815,8 +815,8 @@ static const func_info_t func_infos[] = {
|
||||
F1("array_merge_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_replace", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_replace_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F1("array_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
FN("array_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
FN("array_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_count_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG),
|
||||
F1("array_column", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_reverse", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
@@ -1032,7 +1032,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("curl_multi_exec", MAY_BE_NULL | MAY_BE_LONG),
|
||||
FN("curl_multi_getcontent", MAY_BE_NULL | MAY_BE_STRING),
|
||||
F1("curl_multi_info_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
|
||||
F0("curl_multi_close", MAY_BE_NULL),
|
||||
F0("curl_multi_close", MAY_BE_NULL | MAY_BE_FALSE),
|
||||
F0("curl_multi_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F1("curl_share_init", MAY_BE_NULL | MAY_BE_RESOURCE),
|
||||
F0("curl_share_close", MAY_BE_NULL),
|
||||
@@ -1188,12 +1188,12 @@ static const func_info_t func_infos[] = {
|
||||
F1("hash_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_hmac", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_hmac_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
|
||||
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F0("hash_update_stream", MAY_BE_NULL | MAY_BE_LONG),
|
||||
F0("hash_update_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F1("hash_final", MAY_BE_NULL | MAY_BE_STRING),
|
||||
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
|
||||
F1("hash_algos", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F1("hash_pbkdf2", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("mhash_keygen_s2k", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
#define SYM_RANGE
|
||||
|
||||
/* Whether to handle negative range constraints */
|
||||
#define NEG_RANGE
|
||||
/* Negative range inference is buggy, so disabled for now */
|
||||
#undef NEG_RANGE
|
||||
|
||||
/* Number of warmup passes to use prior to widening */
|
||||
#define RANGE_WARMUP_PASSES 16
|
||||
@@ -157,6 +158,17 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static inline zend_bool add_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a > ZEND_LONG_MAX - b)
|
||||
|| (b < 0 && a < ZEND_LONG_MIN - b);
|
||||
}
|
||||
#if 0
|
||||
static inline zend_bool sub_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a < ZEND_LONG_MIN + b)
|
||||
|| (b < 0 && a > ZEND_LONG_MAX + b);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void zend_ssa_check_scc_var(const zend_op_array *op_array, zend_ssa *ssa, int var, int *index, int *dfs, int *root, zend_worklist_stack *stack) /* {{{ */
|
||||
{
|
||||
#ifdef SYM_RANGE
|
||||
@@ -523,6 +535,15 @@ static inline zend_bool zend_abs_range(
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline zend_bool shift_left_overflows(zend_long n, zend_long s) {
|
||||
/* This considers shifts that shift in the sign bit to be overflowing as well */
|
||||
if (n >= 0) {
|
||||
return s >= SIZEOF_ZEND_LONG * 8 - 1 || (n << s) < n;
|
||||
} else {
|
||||
return s >= SIZEOF_ZEND_LONG * 8 - 1 || (n << s) > n;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the normal op corresponding to a compound assignment op */
|
||||
static inline zend_uchar get_compound_assign_op(zend_uchar opcode) {
|
||||
switch (opcode) {
|
||||
@@ -716,12 +737,27 @@ static int zend_inference_calc_binary_op_range(
|
||||
op2_min = OP2_MIN_RANGE();
|
||||
op1_max = OP1_MAX_RANGE();
|
||||
op2_max = OP2_MAX_RANGE();
|
||||
t1 = op1_min << op2_min;
|
||||
t2 = op1_min << op2_max;
|
||||
t3 = op1_max << op2_min;
|
||||
t4 = op1_max << op2_max;
|
||||
tmp->min = MIN(MIN(t1, t2), MIN(t3, t4));
|
||||
tmp->max = MAX(MAX(t1, t2), MAX(t3, t4));
|
||||
|
||||
/* Shifts by negative numbers will throw, ignore them */
|
||||
if (op2_min < 0) {
|
||||
op2_min = 0;
|
||||
}
|
||||
if (op2_max < 0) {
|
||||
op2_max = 0;
|
||||
}
|
||||
|
||||
if (shift_left_overflows(op1_min, op2_max)
|
||||
|| shift_left_overflows(op1_max, op2_max)) {
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
t1 = op1_min << op2_min;
|
||||
t2 = op1_min << op2_max;
|
||||
t3 = op1_max << op2_min;
|
||||
t4 = op1_max << op2_max;
|
||||
tmp->min = MIN(MIN(t1, t2), MIN(t3, t4));
|
||||
tmp->max = MAX(MAX(t1, t2), MAX(t3, t4));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -739,6 +775,23 @@ static int zend_inference_calc_binary_op_range(
|
||||
op2_min = OP2_MIN_RANGE();
|
||||
op1_max = OP1_MAX_RANGE();
|
||||
op2_max = OP2_MAX_RANGE();
|
||||
|
||||
/* Shifts by negative numbers will throw, ignore them */
|
||||
if (op2_min < 0) {
|
||||
op2_min = 0;
|
||||
}
|
||||
if (op2_max < 0) {
|
||||
op2_max = 0;
|
||||
}
|
||||
|
||||
/* Shifts by more than the integer size will be 0 or -1 */
|
||||
if (op2_min >= SIZEOF_ZEND_LONG * 8) {
|
||||
op2_min = SIZEOF_ZEND_LONG * 8 - 1;
|
||||
}
|
||||
if (op2_max >= SIZEOF_ZEND_LONG * 8) {
|
||||
op2_max = SIZEOF_ZEND_LONG * 8 - 1;
|
||||
}
|
||||
|
||||
t1 = op1_min >> op2_min;
|
||||
t2 = op1_min >> op2_max;
|
||||
t3 = op1_max >> op2_min;
|
||||
@@ -852,7 +905,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow && tmp->underflow;
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (constraint->max_ssa_var < 0) {
|
||||
@@ -860,7 +915,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow && tmp->overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
}
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow && tmp->overflow;
|
||||
#endif
|
||||
}
|
||||
@@ -870,8 +927,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->min = constraint->range.min;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
if (add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->underflow = 1;
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
} else {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->underflow = 1;
|
||||
@@ -882,8 +944,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
if (add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->overflow = 1;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
@@ -1392,11 +1459,15 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case ZEND_COUNT:
|
||||
case ZEND_FUNC_NUM_ARGS:
|
||||
tmp->min = 0;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
return 1;
|
||||
case ZEND_COUNT:
|
||||
/* count() on Countable objects may return negative numbers */
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
return 1;
|
||||
case ZEND_DO_FCALL:
|
||||
case ZEND_DO_ICALL:
|
||||
case ZEND_DO_UCALL:
|
||||
@@ -2050,6 +2121,14 @@ static uint32_t binary_op_result_type(
|
||||
uint32_t tmp = 0;
|
||||
uint32_t t1_type = (t1 & MAY_BE_ANY) | (t1 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
||||
uint32_t t2_type = (t2 & MAY_BE_ANY) | (t2 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
||||
|
||||
/* Handle potentially overloaded operators.
|
||||
* This could be made more precise by checking the class type, if known. */
|
||||
if ((t1_type & MAY_BE_OBJECT) || (t2_type & MAY_BE_OBJECT)) {
|
||||
/* This is somewhat GMP specific. */
|
||||
tmp |= MAY_BE_OBJECT | MAY_BE_FALSE | MAY_BE_RC1;
|
||||
}
|
||||
|
||||
switch (opcode) {
|
||||
case ZEND_ADD:
|
||||
if (t1_type == MAY_BE_LONG && t2_type == MAY_BE_LONG) {
|
||||
@@ -2104,7 +2183,7 @@ static uint32_t binary_op_result_type(
|
||||
* handling */
|
||||
break;
|
||||
case ZEND_MOD:
|
||||
tmp = MAY_BE_LONG;
|
||||
tmp |= MAY_BE_LONG;
|
||||
/* Division by zero results in an exception, so it doesn't need any special handling */
|
||||
break;
|
||||
case ZEND_BW_OR:
|
||||
@@ -2119,7 +2198,7 @@ static uint32_t binary_op_result_type(
|
||||
break;
|
||||
case ZEND_SL:
|
||||
case ZEND_SR:
|
||||
tmp = MAY_BE_LONG;
|
||||
tmp |= MAY_BE_LONG;
|
||||
break;
|
||||
case ZEND_CONCAT:
|
||||
case ZEND_FAST_CONCAT:
|
||||
@@ -2247,6 +2326,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||
if (t1 & (MAY_BE_ANY-MAY_BE_STRING)) {
|
||||
tmp |= MAY_BE_LONG;
|
||||
}
|
||||
if (t1 & MAY_BE_OBJECT) {
|
||||
/* Potentially overloaded operator. */
|
||||
tmp |= MAY_BE_OBJECT | MAY_BE_RC1;
|
||||
}
|
||||
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
|
||||
break;
|
||||
case ZEND_BEGIN_SILENCE:
|
||||
@@ -3699,6 +3782,8 @@ void zend_init_func_return_info(const zend_op_array *op_array,
|
||||
ret->type = zend_fetch_arg_info(script, ret_info, &ret->ce);
|
||||
if (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) {
|
||||
ret->type |= MAY_BE_REF;
|
||||
} else if (ret->type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
|
||||
ret->type |= MAY_BE_RC1|MAY_BE_RCN;
|
||||
}
|
||||
ret->is_instanceof = (ret->ce) ? 1 : 0;
|
||||
ret->range = tmp_range;
|
||||
|
||||
+7
-1
@@ -87,7 +87,13 @@ opcache.max_accelerated_files (default "2000")
|
||||
between 200 and 1000000 are allowed.
|
||||
|
||||
opcache.max_wasted_percentage (default "5")
|
||||
The maximum percentage of "wasted" memory until a restart is scheduled.
|
||||
When the cache fills up this setting decides when to actually reset (dump
|
||||
all entries) it. At the default of 5% it means that if less than 5% of
|
||||
the entries in the now full cache are wasted/orphaned, then you have a good
|
||||
active cache. There is no point emptying a cache full of good entries
|
||||
only to most likely refill it with those same entries. Once more than 5%
|
||||
of the cache consists of wasted entries, the cache will reset in this
|
||||
cache-full scenario. This can be set up to as high as 50%.
|
||||
|
||||
opcache.use_cwd (default "1")
|
||||
When this directive is enabled, the OPcache appends the current working
|
||||
|
||||
@@ -108,6 +108,9 @@ zend_accel_shared_globals *accel_shared_globals = NULL;
|
||||
zend_bool accel_startup_ok = 0;
|
||||
static char *zps_failure_reason = NULL;
|
||||
char *zps_api_failure_reason = NULL;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
zend_bool file_cache_only = 0; /* process uses file cache only */
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
zend_bool fallback_process = 0; /* process uses file cache fallback */
|
||||
#endif
|
||||
@@ -432,7 +435,7 @@ zend_string *accel_new_interned_string(zend_string *str)
|
||||
Bucket *p;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
@@ -1269,8 +1272,8 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
|
||||
#endif
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0);
|
||||
/* Copy into memory block */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0, 0);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1395,7 +1398,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
}
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length);
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length, 1);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1743,7 +1746,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
/* The Accelerator is disabled, act as if without the Accelerator */
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
} else if (ZCG(accel_directives).file_cache_only) {
|
||||
} else if (file_cache_only) {
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
#endif
|
||||
} else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
|
||||
@@ -2042,6 +2045,9 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
|
||||
static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
|
||||
{
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
!file_cache_only &&
|
||||
#endif
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
|
||||
!ZCSG(restart_in_progress)) {
|
||||
|
||||
@@ -2173,7 +2179,7 @@ static void accel_activate(void)
|
||||
ZCG(cwd_check) = 1;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -2367,6 +2373,8 @@ static inline int accel_find_sapi(void)
|
||||
|
||||
static int zend_accel_init_shm(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
zend_shared_alloc_lock();
|
||||
|
||||
accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals));
|
||||
@@ -2414,6 +2422,11 @@ static int zend_accel_init_shm(void)
|
||||
ZCSG(last_restart_time) = 0;
|
||||
ZCSG(restart_in_progress) = 0;
|
||||
|
||||
|
||||
for (i = 0; i < -HT_MIN_MASK; i++) {
|
||||
ZCSG(uninitialized_bucket)[i] = HT_INVALID_IDX;
|
||||
}
|
||||
|
||||
zend_shared_alloc_unlock();
|
||||
|
||||
return SUCCESS;
|
||||
@@ -2632,7 +2645,8 @@ static int accel_startup(zend_extension *extension)
|
||||
/* End of non-SHM dependent initializations */
|
||||
/********************************************/
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (!ZCG(accel_directives).file_cache_only) {
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
if (!file_cache_only) {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
@@ -2664,6 +2678,7 @@ static int accel_startup(zend_extension *extension)
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
case ALLOC_FALLBACK:
|
||||
zend_shared_alloc_lock();
|
||||
file_cache_only = 1;
|
||||
fallback_process = 1;
|
||||
zend_accel_init_auto_globals();
|
||||
zend_shared_alloc_unlock();
|
||||
@@ -2762,7 +2777,7 @@ static void accel_free_ts_resources()
|
||||
void accel_shutdown(void)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
zend_bool file_cache_only = 0;
|
||||
zend_bool _file_cache_only = 0;
|
||||
|
||||
zend_optimizer_shutdown();
|
||||
|
||||
@@ -2774,10 +2789,10 @@ void accel_shutdown(void)
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
_file_cache_only = file_cache_only;
|
||||
#endif
|
||||
|
||||
if (!file_cache_only && ZCG(accel_directives).interned_strings_buffer) {
|
||||
if (!_file_cache_only && ZCG(accel_directives).interned_strings_buffer) {
|
||||
accel_use_permanent_interned_strings();
|
||||
}
|
||||
|
||||
@@ -2785,7 +2800,7 @@ void accel_shutdown(void)
|
||||
|
||||
accel_free_ts_resources();
|
||||
|
||||
if (!file_cache_only) {
|
||||
if (!_file_cache_only) {
|
||||
zend_shared_alloc_shutdown();
|
||||
}
|
||||
zend_compile_file = accelerator_orig_compile_file;
|
||||
|
||||
@@ -120,6 +120,8 @@ extern int lock_file;
|
||||
|
||||
#if defined(HAVE_OPCACHE_FILE_CACHE) && defined(ZEND_WIN32)
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 1
|
||||
#else
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 0
|
||||
#endif
|
||||
|
||||
#if ZEND_WIN32
|
||||
@@ -280,9 +282,14 @@ typedef struct _zend_accel_shared_globals {
|
||||
char *interned_strings_end;
|
||||
char *interned_strings_saved_top;
|
||||
HashTable interned_strings;
|
||||
/* uninitialized HashTable Support */
|
||||
uint32_t uninitialized_bucket[-HT_MIN_MASK];
|
||||
} zend_accel_shared_globals;
|
||||
|
||||
extern zend_bool accel_startup_ok;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
extern zend_bool file_cache_only;
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
extern zend_bool fallback_process;
|
||||
#endif
|
||||
|
||||
@@ -71,7 +71,7 @@ static void zend_win_error_message(int type, char *msg, int err)
|
||||
|
||||
LocalFree( lpMsgBuf );
|
||||
|
||||
zend_accel_error(type, msg);
|
||||
zend_accel_error(type, "%s", msg);
|
||||
}
|
||||
|
||||
static char *create_name_with_username(char *name)
|
||||
@@ -182,9 +182,6 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
|
||||
}
|
||||
accel_shared_globals = (zend_accel_shared_globals *)((char *)((zend_smm_shared_globals *)mapping_base)->app_shared_globals + ((char *)mapping_base - (char *)wanted_mb_save));
|
||||
|
||||
/* Make this process to use file-cache only */
|
||||
ZCG(accel_directives).file_cache_only = 1;
|
||||
|
||||
return ALLOC_FALLBACK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9,8 +9,12 @@ mbstring.func_overload=2
|
||||
<?php
|
||||
|
||||
var_dump(strpos("foo", "o"));
|
||||
var_dump(substr("foo", 1));
|
||||
var_dump(substr("foo", 1, 1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0
|
||||
int(1)
|
||||
string(2) "oo"
|
||||
string(1) "o"
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #75969: Assertion failure in live range DCE due to block pass misoptimization
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// This is required for the segfault
|
||||
md5('foo');
|
||||
|
||||
class Extended_Class {};
|
||||
$response = array(
|
||||
'a' => 'b'
|
||||
);
|
||||
new Extended_Class( array(
|
||||
'foo' => $response,
|
||||
'foo2' => 'bar2'
|
||||
) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76074 (opcache corrupts variable in for-loop)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int $nr) {
|
||||
for ($i = $nr; $i <= $nr + 1; $i++)
|
||||
var_dump($i);
|
||||
}
|
||||
|
||||
test(1);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #76094 (Access violation when using opcache)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function MetaType($t)
|
||||
{
|
||||
|
||||
switch (strtoupper($t)) {
|
||||
case PHP_INT_MAX :
|
||||
return 1;
|
||||
case 0:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(MetaType("aa"));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Incorrect negative range inference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if ($i != 5) {
|
||||
$t = (int) ($i < 5);
|
||||
var_dump($t);
|
||||
}
|
||||
}
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -405,7 +405,7 @@ void zend_accel_override_file_functions(void)
|
||||
zend_function *old_function;
|
||||
if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
zend_accel_error(ACCEL_LOG_WARNING, "file_override_enabled has no effect when file_cache_only is set");
|
||||
return;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
((ZCG(counted) || ZCSG(accelerator_enabled)) || ZCG(accel_directives).file_cache_only)
|
||||
((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
|
||||
#else
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled))
|
||||
#endif
|
||||
@@ -456,7 +456,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
php_info_print_table_row(2, "Optimization", "Disabled");
|
||||
}
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (!ZCG(accel_directives).file_cache_only) {
|
||||
if (!file_cache_only) {
|
||||
php_info_print_table_row(2, "SHM Cache", "Enabled");
|
||||
} else {
|
||||
php_info_print_table_row(2, "SHM Cache", "Disabled");
|
||||
@@ -466,7 +466,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
} else {
|
||||
php_info_print_table_row(2, "File Cache", "Disabled");
|
||||
}
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
if (!accel_startup_ok || zps_api_failure_reason) {
|
||||
php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
|
||||
} else {
|
||||
@@ -615,7 +615,7 @@ static ZEND_FUNCTION(opcache_get_status)
|
||||
if (ZCG(accel_directives).file_cache) {
|
||||
add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
|
||||
}
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
add_assoc_bool(return_value, "file_cache_only", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ static void zend_hash_clone_constants(HashTable *ht, HashTable *source)
|
||||
ht->nNumUsed = 0;
|
||||
ht->nNumOfElements = source->nNumOfElements;
|
||||
ht->nNextFreeElement = source->nNextFreeElement;
|
||||
ht->pDestructor = ZVAL_PTR_DTOR;
|
||||
ht->pDestructor = NULL;
|
||||
ht->u.flags = (source->u.flags & HASH_FLAG_INITIALIZED) | HASH_FLAG_APPLY_PROTECTION;
|
||||
ht->nInternalPointer = source->nNumOfElements ? 0 : HT_INVALID_IDX;
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "zend_interfaces.h"
|
||||
|
||||
#include "php.h"
|
||||
#ifdef ZEND_WIN32
|
||||
#include "ext/standard/md5.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
|
||||
@@ -730,16 +733,43 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
|
||||
size_t len;
|
||||
char *filename;
|
||||
|
||||
#ifndef ZEND_WIN32
|
||||
len = strlen(ZCG(accel_directives).file_cache);
|
||||
filename = emalloc(len + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX));
|
||||
memcpy(filename, ZCG(accel_directives).file_cache, len);
|
||||
#ifndef ZEND_WIN32
|
||||
filename[len] = '/';
|
||||
memcpy(filename + len + 1, ZCG(system_id), 32);
|
||||
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
|
||||
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
|
||||
#else
|
||||
PHP_MD5_CTX ctx;
|
||||
char md5uname[32];
|
||||
unsigned char digest[16], c;
|
||||
size_t i;
|
||||
char *uname = php_win32_get_username();
|
||||
|
||||
PHP_MD5Init(&ctx);
|
||||
PHP_MD5Update(&ctx, uname, strlen(uname));
|
||||
PHP_MD5Final(digest, &ctx);
|
||||
for (i = 0; i < 16; i++) {
|
||||
c = digest[i] >> 4;
|
||||
c = (c <= 9) ? c + '0' : c - 10 + 'a';
|
||||
md5uname[i * 2] = c;
|
||||
c = digest[i] & 0x0f;
|
||||
c = (c <= 9) ? c + '0' : c - 10 + 'a';
|
||||
md5uname[(i * 2) + 1] = c;
|
||||
}
|
||||
|
||||
len = strlen(ZCG(accel_directives).file_cache);
|
||||
|
||||
filename = emalloc(len + 33 + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX));
|
||||
|
||||
memcpy(filename, ZCG(accel_directives).file_cache, len);
|
||||
filename[len] = '\\';
|
||||
memcpy(filename + 1 + len, md5uname, 32);
|
||||
len += 32;
|
||||
filename[len] = '\\';
|
||||
|
||||
memcpy(filename + len + 1, ZCG(system_id), 32);
|
||||
if (ZSTR_LEN(script_path) >= 2 && ':' == ZSTR_VAL(script_path)[1]) {
|
||||
/* local fs */
|
||||
@@ -752,6 +782,7 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
|
||||
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
|
||||
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
|
||||
}
|
||||
free(uname);
|
||||
#endif
|
||||
|
||||
return filename;
|
||||
@@ -871,7 +902,11 @@ static void zend_file_cache_unserialize_hash(HashTable *ht,
|
||||
|
||||
ht->pDestructor = dtor;
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!file_cache_only)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (IS_UNSERIALIZED(ht->arData)) {
|
||||
@@ -1193,7 +1228,7 @@ static void zend_file_cache_unserialize_class(zval *zv,
|
||||
UNSERIALIZE_STR(ce->info.user.filename);
|
||||
UNSERIALIZE_STR(ce->info.user.doc_comment);
|
||||
zend_file_cache_unserialize_hash(&ce->properties_info,
|
||||
script, buf, zend_file_cache_unserialize_prop_info, ZVAL_PTR_DTOR);
|
||||
script, buf, zend_file_cache_unserialize_prop_info, NULL);
|
||||
|
||||
if (ce->trait_aliases) {
|
||||
zend_trait_alias **p, *q;
|
||||
@@ -1403,7 +1438,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ZCG(accel_directives).file_cache_only &&
|
||||
if (!file_cache_only &&
|
||||
!ZCSG(restart_in_progress) &&
|
||||
!ZSMMG(memory_exhausted) &&
|
||||
accelerator_shm_read_lock() == SUCCESS) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
#define zend_set_str_gc_flags(str) do { \
|
||||
if (ZCG(accel_directives).file_cache_only) { \
|
||||
if (file_cache_only) { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED; \
|
||||
} else { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
|
||||
@@ -86,14 +86,24 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
|
||||
uint32_t idx, nIndex;
|
||||
Bucket *p;
|
||||
|
||||
ht->pDestructor = NULL;
|
||||
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ht->nNumUsed == 0) {
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
ht->nTableMask = HT_MIN_MASK;
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
ht->u.flags &= ~HASH_FLAG_INITIALIZED;
|
||||
return;
|
||||
}
|
||||
@@ -170,14 +180,24 @@ static void zend_hash_persist_immutable(HashTable *ht)
|
||||
uint32_t idx, nIndex;
|
||||
Bucket *p;
|
||||
|
||||
ht->pDestructor = NULL;
|
||||
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ht->nNumUsed == 0) {
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
ht->nTableMask = HT_MIN_MASK;
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
ht->u.flags &= ~HASH_FLAG_INITIALIZED;
|
||||
return;
|
||||
}
|
||||
@@ -829,7 +849,7 @@ static void zend_accel_persist_class_table(HashTable *class_table)
|
||||
zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
|
||||
}
|
||||
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length, int for_shm)
|
||||
{
|
||||
script->mem = ZCG(mem);
|
||||
|
||||
@@ -840,6 +860,15 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
|
||||
if (key && *key) {
|
||||
*key = zend_accel_memdup(*key, key_length + 1);
|
||||
}
|
||||
|
||||
script->corrupted = 0;
|
||||
ZCG(current_persistent_script) = script;
|
||||
|
||||
if (!for_shm) {
|
||||
/* script is not going to be saved in SHM */
|
||||
script->corrupted = 1;
|
||||
}
|
||||
|
||||
zend_accel_store_interned_string(script->script.filename);
|
||||
|
||||
#ifdef __SSE2__
|
||||
@@ -856,6 +885,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
|
||||
zend_hash_persist(&script->script.function_table, zend_persist_op_array);
|
||||
zend_persist_op_array_ex(&script->script.main_op_array, script);
|
||||
|
||||
script->corrupted = 0;
|
||||
ZCG(current_persistent_script) = NULL;
|
||||
|
||||
return script;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
int zend_accel_script_persistable(zend_persistent_script *script);
|
||||
uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length, int for_shm);
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length, int for_shm);
|
||||
|
||||
#endif /* ZEND_PERSIST_H */
|
||||
@@ -154,12 +154,12 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_check_private_key, 0)
|
||||
ZEND_ARG_INFO(0, key)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_parse, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_parse, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, x509)
|
||||
ZEND_ARG_INFO(0, shortname)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_checkpurpose, 0, 0, 3)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_checkpurpose, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, x509cert)
|
||||
ZEND_ARG_INFO(0, purpose)
|
||||
ZEND_ARG_INFO(0, cainfo) /* array */
|
||||
@@ -182,7 +182,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs12_export_to_file, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, args) /* array */
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkcs12_export, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs12_export, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, x509)
|
||||
ZEND_ARG_INFO(1, out)
|
||||
ZEND_ARG_INFO(0, priv_key)
|
||||
@@ -224,12 +224,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_new, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, extraattribs)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_csr_get_subject, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_get_subject, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, csr)
|
||||
ZEND_ARG_INFO(0, use_shortnames)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_csr_get_public_key, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_get_public_key, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, csr)
|
||||
ZEND_ARG_INFO(0, use_shortnames)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkey_new, 0, 0, 0)
|
||||
@@ -6807,4 +6809,3 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
||||
+22
-7
@@ -770,14 +770,17 @@ PHP_FUNCTION(pcntl_wifexited)
|
||||
{
|
||||
#ifdef WIFEXITED
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (WIFEXITED(status_word))
|
||||
int_status_word = (int) status_word;
|
||||
if (WIFEXITED(int_status_word))
|
||||
RETURN_TRUE;
|
||||
#endif
|
||||
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -788,12 +791,14 @@ PHP_FUNCTION(pcntl_wifstopped)
|
||||
{
|
||||
#ifdef WIFSTOPPED
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (WIFSTOPPED(status_word))
|
||||
int_status_word = (int) status_word;
|
||||
if (WIFSTOPPED(int_status_word))
|
||||
RETURN_TRUE;
|
||||
#endif
|
||||
RETURN_FALSE;
|
||||
@@ -806,12 +811,14 @@ PHP_FUNCTION(pcntl_wifsignaled)
|
||||
{
|
||||
#ifdef WIFSIGNALED
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (WIFSIGNALED(status_word))
|
||||
int_status_word = (int) status_word;
|
||||
if (WIFSIGNALED(int_status_word))
|
||||
RETURN_TRUE;
|
||||
#endif
|
||||
RETURN_FALSE;
|
||||
@@ -823,12 +830,14 @@ PHP_FUNCTION(pcntl_wifcontinued)
|
||||
{
|
||||
#ifdef HAVE_WCONTINUED
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (WIFCONTINUED(status_word))
|
||||
int_status_word = (int) status_word;
|
||||
if (WIFCONTINUED(int_status_word))
|
||||
RETURN_TRUE;
|
||||
#endif
|
||||
RETURN_FALSE;
|
||||
@@ -842,12 +851,14 @@ PHP_FUNCTION(pcntl_wexitstatus)
|
||||
{
|
||||
#ifdef WEXITSTATUS
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(WEXITSTATUS(status_word));
|
||||
int_status_word = (int) status_word;
|
||||
RETURN_LONG(WEXITSTATUS(int_status_word));
|
||||
#else
|
||||
RETURN_FALSE;
|
||||
#endif
|
||||
@@ -860,12 +871,14 @@ PHP_FUNCTION(pcntl_wtermsig)
|
||||
{
|
||||
#ifdef WTERMSIG
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(WTERMSIG(status_word));
|
||||
int_status_word = (int) status_word;
|
||||
RETURN_LONG(WTERMSIG(int_status_word));
|
||||
#else
|
||||
RETURN_FALSE;
|
||||
#endif
|
||||
@@ -878,12 +891,14 @@ PHP_FUNCTION(pcntl_wstopsig)
|
||||
{
|
||||
#ifdef WSTOPSIG
|
||||
zend_long status_word;
|
||||
int int_status_word;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(WSTOPSIG(status_word));
|
||||
int_status_word = (int) status_word;
|
||||
RETURN_LONG(WSTOPSIG(int_status_word));
|
||||
#else
|
||||
RETURN_FALSE;
|
||||
#endif
|
||||
|
||||
@@ -618,11 +618,13 @@ static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, PGcon
|
||||
}
|
||||
efree(querystr);
|
||||
|
||||
if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
|
||||
if (1 == PQgetisnull(tmp_res, 0, 0) || (table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
|
||||
PQclear(tmp_res);
|
||||
return 0;
|
||||
}
|
||||
|
||||
table_name = estrdup(table_name);
|
||||
|
||||
PQclear(tmp_res);
|
||||
return table_name;
|
||||
}
|
||||
@@ -652,6 +654,7 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r
|
||||
table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H->server);
|
||||
if (table_name) {
|
||||
add_assoc_string(return_value, "table", table_name);
|
||||
efree(table_name);
|
||||
}
|
||||
|
||||
switch (S->cols[colno].pgsql_type) {
|
||||
|
||||
@@ -308,8 +308,7 @@ static void phar_do_403(char *entry, int entry_len) /* {{{ */
|
||||
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
|
||||
sapi_send_headers();
|
||||
PHPWRITE("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ", sizeof("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ") - 1);
|
||||
PHPWRITE(entry, entry_len);
|
||||
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
|
||||
PHPWRITE("Access Denied</h1>\n </body>\n</html>", sizeof("Access Denied</h1>\n </body>\n</html>") - 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -333,8 +332,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
|
||||
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
|
||||
sapi_send_headers();
|
||||
PHPWRITE("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ", sizeof("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ") - 1);
|
||||
PHPWRITE(entry, entry_len);
|
||||
PHPWRITE(" Not Found</h1>\n </body>\n</html>", sizeof(" Not Found</h1>\n </body>\n</html>") - 1);
|
||||
PHPWRITE("Not Found</h1>\n </body>\n</html>", sizeof("Not Found</h1>\n </body>\n</html>") - 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+155
-198
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
/* Generated by re2c 0.16 */
|
||||
#line 1 "ext/phar/phar_path_check.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -47,158 +47,52 @@ loop:
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
|
||||
if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
|
||||
yych = *YYCURSOR;
|
||||
if (yych <= '[') {
|
||||
if (yych <= ')') {
|
||||
if (yych <= '\t') {
|
||||
if (yych <= 0x00) goto yy21;
|
||||
goto yy23;
|
||||
if (yych <= '\f') {
|
||||
if (yych >= 0x01) goto yy4;
|
||||
} else {
|
||||
if (yych <= '\n') goto yy2;
|
||||
if (yych <= 0x19) goto yy23;
|
||||
goto yy11;
|
||||
if (yych <= '\r') goto yy6;
|
||||
if (yych <= 0x19) goto yy4;
|
||||
goto yy7;
|
||||
}
|
||||
} else {
|
||||
if (yych <= '/') {
|
||||
if (yych <= '*') goto yy7;
|
||||
if (yych <= '.') goto yy11;
|
||||
goto yy3;
|
||||
} else {
|
||||
if (yych == '?') goto yy9;
|
||||
if (yych <= '*') goto yy9;
|
||||
if (yych <= '.') goto yy7;
|
||||
goto yy11;
|
||||
} else {
|
||||
if (yych == '?') goto yy12;
|
||||
goto yy7;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (yych <= 0xEC) {
|
||||
if (yych <= 0xC1) {
|
||||
if (yych <= '\\') goto yy5;
|
||||
if (yych <= 0x7F) goto yy11;
|
||||
goto yy23;
|
||||
if (yych <= '\\') goto yy14;
|
||||
if (yych <= 0x7F) goto yy7;
|
||||
goto yy4;
|
||||
} else {
|
||||
if (yych <= 0xDF) goto yy12;
|
||||
if (yych <= 0xE0) goto yy14;
|
||||
goto yy15;
|
||||
if (yych <= 0xDF) goto yy16;
|
||||
if (yych <= 0xE0) goto yy17;
|
||||
goto yy18;
|
||||
}
|
||||
} else {
|
||||
if (yych <= 0xF0) {
|
||||
if (yych <= 0xED) goto yy16;
|
||||
if (yych <= 0xEF) goto yy17;
|
||||
goto yy18;
|
||||
if (yych <= 0xED) goto yy19;
|
||||
if (yych <= 0xEF) goto yy18;
|
||||
goto yy20;
|
||||
} else {
|
||||
if (yych <= 0xF3) goto yy19;
|
||||
if (yych <= 0xF4) goto yy20;
|
||||
goto yy23;
|
||||
if (yych <= 0xF3) goto yy21;
|
||||
if (yych <= 0xF4) goto yy22;
|
||||
goto yy4;
|
||||
}
|
||||
}
|
||||
}
|
||||
yy2:
|
||||
YYCURSOR = YYMARKER;
|
||||
if (yyaccept <= 0) {
|
||||
goto yy4;
|
||||
} else {
|
||||
goto yy13;
|
||||
}
|
||||
yy3:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '-') goto yy4;
|
||||
if (yych <= '.') goto yy35;
|
||||
if (yych <= '/') goto yy36;
|
||||
yy4:
|
||||
#line 88 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
goto loop;
|
||||
}
|
||||
#line 115 "ext/phar/phar_path_check.c"
|
||||
yy5:
|
||||
++YYCURSOR;
|
||||
#line 72 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "back-slash";
|
||||
return pcr_err_back_slash;
|
||||
}
|
||||
#line 123 "ext/phar/phar_path_check.c"
|
||||
yy7:
|
||||
++YYCURSOR;
|
||||
#line 76 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "star";
|
||||
return pcr_err_star;
|
||||
}
|
||||
#line 131 "ext/phar/phar_path_check.c"
|
||||
yy9:
|
||||
++YYCURSOR;
|
||||
#line 80 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
if (**s == '/') {
|
||||
(*s)++;
|
||||
}
|
||||
*len = (p - (const unsigned char*)*s) -1;
|
||||
*error = NULL;
|
||||
return pcr_use_query;
|
||||
}
|
||||
#line 143 "ext/phar/phar_path_check.c"
|
||||
yy11:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy4;
|
||||
yy12:
|
||||
++YYCURSOR;
|
||||
if ((yych = *YYCURSOR) <= 0x7F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
yy13:
|
||||
#line 104 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error ="illegal character";
|
||||
return pcr_err_illegal_char;
|
||||
}
|
||||
#line 157 "ext/phar/phar_path_check.c"
|
||||
yy14:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x9F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy34;
|
||||
goto yy13;
|
||||
yy15:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy33;
|
||||
goto yy13;
|
||||
yy16:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy13;
|
||||
if (yych <= 0x9F) goto yy32;
|
||||
goto yy13;
|
||||
yy17:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy31;
|
||||
goto yy13;
|
||||
yy18:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x8F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy29;
|
||||
goto yy13;
|
||||
yy19:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy13;
|
||||
if (yych <= 0xBF) goto yy27;
|
||||
goto yy13;
|
||||
yy20:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy13;
|
||||
if (yych <= 0x8F) goto yy24;
|
||||
goto yy13;
|
||||
yy21:
|
||||
++YYCURSOR;
|
||||
#line 91 "ext/phar/phar_path_check.re"
|
||||
#line 93 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
if (**s == '/') {
|
||||
(*s)++;
|
||||
@@ -212,93 +106,156 @@ yy21:
|
||||
*error = NULL;
|
||||
return pcr_is_ok;
|
||||
}
|
||||
#line 216 "ext/phar/phar_path_check.c"
|
||||
#line 110 "ext/phar/phar_path_check.c"
|
||||
yy4:
|
||||
++YYCURSOR;
|
||||
yy5:
|
||||
#line 106 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error ="illegal character";
|
||||
return pcr_err_illegal_char;
|
||||
}
|
||||
#line 119 "ext/phar/phar_path_check.c"
|
||||
yy6:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '\n') goto yy4;
|
||||
goto yy5;
|
||||
yy7:
|
||||
++YYCURSOR;
|
||||
yy8:
|
||||
#line 90 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
goto loop;
|
||||
}
|
||||
#line 131 "ext/phar/phar_path_check.c"
|
||||
yy9:
|
||||
++YYCURSOR;
|
||||
#line 78 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "star";
|
||||
return pcr_err_star;
|
||||
}
|
||||
#line 139 "ext/phar/phar_path_check.c"
|
||||
yy11:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '-') goto yy8;
|
||||
if (yych <= '.') goto yy23;
|
||||
if (yych <= '/') goto yy25;
|
||||
goto yy8;
|
||||
yy12:
|
||||
++YYCURSOR;
|
||||
#line 82 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
if (**s == '/') {
|
||||
(*s)++;
|
||||
}
|
||||
*len = (p - (const unsigned char*)*s) -1;
|
||||
*error = NULL;
|
||||
return pcr_use_query;
|
||||
}
|
||||
#line 158 "ext/phar/phar_path_check.c"
|
||||
yy14:
|
||||
++YYCURSOR;
|
||||
#line 74 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "back-slash";
|
||||
return pcr_err_back_slash;
|
||||
}
|
||||
#line 166 "ext/phar/phar_path_check.c"
|
||||
yy16:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy5;
|
||||
if (yych <= 0xBF) goto yy7;
|
||||
goto yy5;
|
||||
yy17:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x9F) goto yy5;
|
||||
if (yych <= 0xBF) goto yy27;
|
||||
goto yy5;
|
||||
yy18:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy5;
|
||||
if (yych <= 0xBF) goto yy27;
|
||||
goto yy5;
|
||||
yy19:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy5;
|
||||
if (yych <= 0x9F) goto yy27;
|
||||
goto yy5;
|
||||
yy20:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x8F) goto yy5;
|
||||
if (yych <= 0xBF) goto yy28;
|
||||
goto yy5;
|
||||
yy21:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy5;
|
||||
if (yych <= 0xBF) goto yy28;
|
||||
goto yy5;
|
||||
yy22:
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x7F) goto yy5;
|
||||
if (yych <= 0x8F) goto yy28;
|
||||
goto yy5;
|
||||
yy23:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy13;
|
||||
if (yych <= 0x00) goto yy29;
|
||||
if (yych <= '-') goto yy24;
|
||||
if (yych <= '.') goto yy31;
|
||||
if (yych <= '/') goto yy29;
|
||||
yy24:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych >= 0xC0) goto yy2;
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych >= 0xC0) goto yy2;
|
||||
yy26:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy4;
|
||||
yy27:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych >= 0xC0) goto yy2;
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy29:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych >= 0xC0) goto yy2;
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy31:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy32:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy33:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy34:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy2;
|
||||
if (yych <= 0xBF) goto yy26;
|
||||
goto yy2;
|
||||
yy35:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x00) goto yy39;
|
||||
if (yych <= '-') goto yy2;
|
||||
if (yych <= '.') goto yy38;
|
||||
if (yych <= '/') goto yy39;
|
||||
goto yy2;
|
||||
yy36:
|
||||
YYCURSOR = YYMARKER;
|
||||
if (yyaccept == 0) {
|
||||
goto yy8;
|
||||
} else {
|
||||
goto yy5;
|
||||
}
|
||||
yy25:
|
||||
++YYCURSOR;
|
||||
#line 60 "ext/phar/phar_path_check.re"
|
||||
#line 62 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "double slash";
|
||||
return pcr_err_double_slash;
|
||||
}
|
||||
#line 280 "ext/phar/phar_path_check.c"
|
||||
yy38:
|
||||
#line 228 "ext/phar/phar_path_check.c"
|
||||
yy27:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x00) goto yy41;
|
||||
if (yych == '/') goto yy41;
|
||||
goto yy2;
|
||||
yy39:
|
||||
if (yych <= 0x7F) goto yy24;
|
||||
if (yych <= 0xBF) goto yy7;
|
||||
goto yy24;
|
||||
yy28:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x7F) goto yy24;
|
||||
if (yych <= 0xBF) goto yy27;
|
||||
goto yy24;
|
||||
yy29:
|
||||
++YYCURSOR;
|
||||
#line 68 "ext/phar/phar_path_check.re"
|
||||
#line 70 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "current directory reference";
|
||||
return pcr_err_curr_dir;
|
||||
}
|
||||
#line 293 "ext/phar/phar_path_check.c"
|
||||
yy41:
|
||||
#line 246 "ext/phar/phar_path_check.c"
|
||||
yy31:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x00) goto yy32;
|
||||
if (yych != '/') goto yy24;
|
||||
yy32:
|
||||
++YYCURSOR;
|
||||
#line 64 "ext/phar/phar_path_check.re"
|
||||
#line 66 "ext/phar/phar_path_check.re"
|
||||
{
|
||||
*error = "upper directory reference";
|
||||
return pcr_err_up_dir;
|
||||
}
|
||||
#line 301 "ext/phar/phar_path_check.c"
|
||||
#line 258 "ext/phar/phar_path_check.c"
|
||||
}
|
||||
#line 108 "ext/phar/phar_path_check.re"
|
||||
#line 110 "ext/phar/phar_path_check.re"
|
||||
|
||||
}
|
||||
@@ -41,7 +41,8 @@ phar_path_check_result phar_path_check(char **s, int *len, const char **error)
|
||||
|
||||
loop:
|
||||
/*!re2c
|
||||
END = "\x00";
|
||||
END = "\x00";
|
||||
NEWLINE = "\r"? "\n";
|
||||
UTF8T = [\x80-\xBF] ;
|
||||
UTF8_1 = [\x1A-\x7F] ;
|
||||
UTF8_2 = [\xC2-\xDF] UTF8T ;
|
||||
@@ -55,8 +56,9 @@ UTF8_4B = [\xF1-\xF3] UTF8T{3} ;
|
||||
UTF8_4C = "\xF4" [\x80-\x8F] UTF8T{2} ;
|
||||
UTF8_4 = UTF8_4A | UTF8_4B | UTF8_4C ;
|
||||
UTF8 = UTF8_1 | UTF8_2 | UTF8_3 | UTF8_4 ;
|
||||
EOS = "/" | END;
|
||||
ANY = .;
|
||||
EOS = "/" | END;
|
||||
ANY = . | NEWLINE;
|
||||
|
||||
"//" {
|
||||
*error = "double slash";
|
||||
return pcr_err_double_slash;
|
||||
|
||||
@@ -20,6 +20,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,6 +18,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,6 +18,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -17,6 +17,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,7 +7,7 @@ Olivier Doucet Olivier Doucet Boris Lytochkin
|
||||
require_once(dirname(__FILE__).'/skipif.inc');
|
||||
require_once(dirname(__FILE__).'/snmp_include.inc');
|
||||
|
||||
if (!file_exists($mibdir . '/SNMPv2-MIB.txt')) die('MIB file not in the system');
|
||||
if (!file_exists($mibdir . '/SNMPv2-MIB.txt')) die('skip MIB file not in the system');
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
+9
-11
@@ -1521,6 +1521,7 @@ PHP_METHOD(SoapServer, handle)
|
||||
xmlCharEncodingHandlerPtr old_encoding;
|
||||
HashTable *old_class_map, *old_typemap;
|
||||
int old_features;
|
||||
zval tmp_soap;
|
||||
|
||||
SOAP_SERVER_BEGIN_CODE();
|
||||
|
||||
@@ -1684,8 +1685,7 @@ PHP_METHOD(SoapServer, handle)
|
||||
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
|
||||
/* If persistent then set soap_obj from from the previous created session (if available) */
|
||||
if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
|
||||
zval *tmp_soap;
|
||||
zval *session_vars;
|
||||
zval *session_vars, *tmp_soap_p;
|
||||
|
||||
if (PS(session_status) != php_session_active &&
|
||||
PS(session_status) != php_session_disabled) {
|
||||
@@ -1696,16 +1696,15 @@ PHP_METHOD(SoapServer, handle)
|
||||
session_vars = &PS(http_session_vars);
|
||||
ZVAL_DEREF(session_vars);
|
||||
if (Z_TYPE_P(session_vars) == IS_ARRAY &&
|
||||
(tmp_soap = zend_hash_str_find(Z_ARRVAL_P(session_vars), "_bogus_session_name", sizeof("_bogus_session_name")-1)) != NULL &&
|
||||
Z_TYPE_P(tmp_soap) == IS_OBJECT &&
|
||||
Z_OBJCE_P(tmp_soap) == service->soap_class.ce) {
|
||||
soap_obj = tmp_soap;
|
||||
(tmp_soap_p = zend_hash_str_find(Z_ARRVAL_P(session_vars), "_bogus_session_name", sizeof("_bogus_session_name")-1)) != NULL &&
|
||||
Z_TYPE_P(tmp_soap_p) == IS_OBJECT &&
|
||||
Z_OBJCE_P(tmp_soap_p) == service->soap_class.ce) {
|
||||
soap_obj = tmp_soap_p;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* If new session or something weird happned */
|
||||
if (soap_obj == NULL) {
|
||||
zval tmp_soap;
|
||||
|
||||
object_init_ex(&tmp_soap, service->soap_class.ce);
|
||||
|
||||
@@ -1758,13 +1757,12 @@ PHP_METHOD(SoapServer, handle)
|
||||
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
|
||||
/* If session then update session hash with new object */
|
||||
if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
|
||||
zval *tmp_soap_pp;
|
||||
zval *session_vars = &PS(http_session_vars);
|
||||
zval *session_vars = &PS(http_session_vars), *tmp_soap_p;
|
||||
|
||||
ZVAL_DEREF(session_vars);
|
||||
if (Z_TYPE_P(session_vars) == IS_ARRAY &&
|
||||
(tmp_soap_pp = zend_hash_str_update(Z_ARRVAL_P(session_vars), "_bogus_session_name", sizeof("_bogus_session_name")-1, &tmp_soap)) != NULL) {
|
||||
soap_obj = tmp_soap_pp;
|
||||
(tmp_soap_p = zend_hash_str_update(Z_ARRVAL_P(session_vars), "_bogus_session_name", sizeof("_bogus_session_name")-1, &tmp_soap)) != NULL) {
|
||||
soap_obj = tmp_soap_p;
|
||||
} else {
|
||||
soap_obj = &tmp_soap;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,19 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
AC_DEFINE(HAVE_AI_ALL,1,[Whether you have AI_ALL])
|
||||
fi
|
||||
|
||||
dnl Check for AI_IDN flag
|
||||
AC_CACHE_CHECK([if getaddrinfo supports AI_IDN],[ac_cv_gai_ai_idn],
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
#include <netdb.h>
|
||||
], [int flag = AI_IDN;],
|
||||
ac_cv_gai_ai_idn=yes, ac_cv_gai_ai_idn=no)
|
||||
])
|
||||
|
||||
if test "$ac_cv_gai_ai_idn" = yes; then
|
||||
AC_DEFINE(HAVE_AI_IDN,1,[Whether you have AI_IDN])
|
||||
fi
|
||||
|
||||
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
|
||||
fi
|
||||
@@ -796,7 +796,7 @@ static PHP_MINIT_FUNCTION(sockets)
|
||||
REGISTER_LONG_CONSTANT("AI_ALL", AI_ALL, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("AI_ADDRCONFIG", AI_ADDRCONFIG, CONST_CS | CONST_PERSISTENT);
|
||||
#ifdef __USE_GNU
|
||||
#if HAVE_AI_IDN
|
||||
REGISTER_LONG_CONSTANT("AI_IDN", AI_IDN, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("AI_CANONIDN", AI_CANONIDN, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("AI_IDN_ALLOW_UNASSIGNED", AI_IDN_ALLOW_UNASSIGNED, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -2531,7 +2531,7 @@ PHP_FUNCTION(socket_addrinfo_lookup)
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|sa", &hostname, &service, &service_len, &zhints) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|sa", &hostname, &service, &service_len, &zhints) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ if (!extension_loaded('sockets')) {
|
||||
die('skip sockets extension not available.');
|
||||
}
|
||||
if (PHP_OS !== 'Darwin') {
|
||||
die('is not OSX.');
|
||||
die('skip Is not OSX.');
|
||||
}
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
+2
-2
@@ -1883,8 +1883,8 @@ outexcept:
|
||||
|
||||
/* {{{ arginfo and function table */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, array)
|
||||
ZEND_ARG_INFO(0, ar_flags)
|
||||
ZEND_ARG_INFO(0, input)
|
||||
ZEND_ARG_INFO(0, flags)
|
||||
ZEND_ARG_INFO(0, iterator_class)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
|
||||
ZEND_ARG_INFO(0, proper_address)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, varname)
|
||||
ZEND_ARG_INFO(0, local_only)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -1382,7 +1382,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
/* {{{ fsock.c */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, hostname)
|
||||
ZEND_ARG_INFO(0, port)
|
||||
ZEND_ARG_INFO(1, errno)
|
||||
@@ -1390,7 +1390,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, timeout)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, hostname)
|
||||
ZEND_ARG_INFO(0, port)
|
||||
ZEND_ARG_INFO(1, errno)
|
||||
@@ -2197,7 +2197,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
|
||||
ZEND_ARG_INFO(0, pieces)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_strtok, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_strtok, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, str)
|
||||
ZEND_ARG_INFO(0, token)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -2463,7 +2463,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, split_length)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, haystack)
|
||||
ZEND_ARG_INFO(0, char_list)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user