mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 03:30:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f58f5ccf0 | ||
|
|
4fbbcc8cc3 | ||
|
|
c5b295d8ec | ||
|
|
f4300cc374 | ||
|
|
951e29f66e | ||
|
|
5fbb0988d1 | ||
|
|
73bf238507 | ||
|
|
d5ee654b71 | ||
|
|
5bf8032112 | ||
|
|
97a8483143 | ||
|
|
4455899a93 | ||
|
|
34fb42970a | ||
|
|
974c46b89b | ||
|
|
a422b1e60c | ||
|
|
be11b354f4 | ||
|
|
a9d00be024 | ||
|
|
dc461d6f56 | ||
|
|
8f221bdec0 | ||
|
|
a231860b02 | ||
|
|
68c3d09c2c | ||
|
|
1c8c06a403 | ||
|
|
bc6ddb7f45 | ||
|
|
364fad275e | ||
|
|
5681f6523b | ||
|
|
a8a1dc038c | ||
|
|
aebbf38df5 | ||
|
|
83626ef97a | ||
|
|
6fc405e851 | ||
|
|
589f8107e8 | ||
|
|
f7b431fb30 | ||
|
|
6043a2d6f7 | ||
|
|
b027071688 | ||
|
|
33382dc7ee | ||
|
|
798e707eb3 | ||
|
|
d6bc266ba0 | ||
|
|
e470068293 | ||
|
|
b2429259af | ||
|
|
a8422edced | ||
|
|
ee0ca6470d | ||
|
|
c8ab9e1e53 | ||
|
|
11e36411c1 | ||
|
|
2d9836a579 | ||
|
|
1228f31cd2 | ||
|
|
9b8d8cac04 | ||
|
|
cbee239262 | ||
|
|
683635dff6 | ||
|
|
4dedccd8e2 | ||
|
|
398204ace9 | ||
|
|
ad787626a4 | ||
|
|
41aa83f0c2 | ||
|
|
d21612401f | ||
|
|
6c3b70e9a5 | ||
|
|
1a25137a69 | ||
|
|
348b5eb434 | ||
|
|
d057d767cc | ||
|
|
8ad44700cf | ||
|
|
ea642026eb | ||
|
|
637e47a5ed | ||
|
|
538ff93876 | ||
|
|
54ca2e7f8c | ||
|
|
b00a5c03e6 | ||
|
|
b0def5bde9 | ||
|
|
6b85926104 | ||
|
|
e01d0387d1 | ||
|
|
f59b201f19 | ||
|
|
3fe2e2a372 | ||
|
|
5b3e1ded35 | ||
|
|
afc3f6e8d5 | ||
|
|
3139be0bea | ||
|
|
7ba70a5fed | ||
|
|
d3ae4fe2d2 | ||
|
|
beab622265 | ||
|
|
35713efa02 | ||
|
|
d990b9316a | ||
|
|
7f090ac16a | ||
|
|
643c9c9b47 | ||
|
|
a0d8cedd2b | ||
|
|
df4d0a73d2 | ||
|
|
f8c1ce18e9 | ||
|
|
c547c1b980 | ||
|
|
c6ce03e45e | ||
|
|
4c083e7a66 | ||
|
|
6738d19fb8 | ||
|
|
2c602be7c8 | ||
|
|
279ba58edb | ||
|
|
972c4869a7 | ||
|
|
2513da4b4c | ||
|
|
b3fff5fc41 | ||
|
|
435e812c09 | ||
|
|
7c852a7961 | ||
|
|
98ef183ed0 | ||
|
|
8677edb2dd | ||
|
|
029a60b2c7 | ||
|
|
127273327b | ||
|
|
5ac5f313bd | ||
|
|
fe3d53f443 | ||
|
|
42344cdc53 | ||
|
|
d8f2e1a511 | ||
|
|
4b42056042 | ||
|
|
090fef553d | ||
|
|
6e5287bb95 | ||
|
|
befdc10c32 | ||
|
|
31c3646757 | ||
|
|
1df43a086f | ||
|
|
919ead1157 | ||
|
|
3070883bcf | ||
|
|
4371af3e19 | ||
|
|
4c06d929c0 | ||
|
|
95ee9efa57 | ||
|
|
5a18d7a0df | ||
|
|
ee76a5ae5a | ||
|
|
58b0003975 | ||
|
|
a4c55eefd0 | ||
|
|
6e64aba47f | ||
|
|
e2dcf3cc54 | ||
|
|
8dca5ae5ec | ||
|
|
49782c5499 | ||
|
|
06d309fd7a | ||
|
|
83e7618f05 | ||
|
|
ff83c00715 | ||
|
|
b4e4788c44 | ||
|
|
98e43a33c8 | ||
|
|
2ef8809ef3 | ||
|
|
ac732d75bd | ||
|
|
9090a21de0 | ||
|
|
b8aec1e725 | ||
|
|
4e407b8777 | ||
|
|
4302c0b542 | ||
|
|
4ea7f3467d | ||
|
|
3770c2e463 | ||
|
|
bb79e5764b | ||
|
|
281a1754b9 | ||
|
|
9f4905fb0d | ||
|
|
5fe6d2134b | ||
|
|
ab68d90057 | ||
|
|
ab200bd660 | ||
|
|
68296c4055 | ||
|
|
9322b43d65 | ||
|
|
0d87a0ba57 | ||
|
|
36239fee36 |
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.3
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.5
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
@@ -16,9 +16,11 @@ define ____executor_globals
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
set $eg_ptr = $eg
|
||||
else
|
||||
set $eg = executor_globals
|
||||
set $cg = compiler_globals
|
||||
set $eg_ptr = (zend_executor_globals*) &executor_globals
|
||||
end
|
||||
end
|
||||
|
||||
@@ -289,6 +291,16 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define print_global_vars
|
||||
____executor_globals
|
||||
set $symtable = ((HashTable *)&($eg_ptr->symbol_table))
|
||||
print_ht $symtable
|
||||
end
|
||||
|
||||
document print_global_vars
|
||||
Prints the global variables
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
|
||||
@@ -1,6 +1,58 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2018, PHP 7.2.5
|
||||
21 Jun 2018, PHP 7.2.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76337 (segfault when opcache enabled + extension use
|
||||
zend_register_class_alias). (xKhorasan)
|
||||
|
||||
- CLI Server:
|
||||
. Fixed bug #76333 (PHP built-in server does not find files if root path
|
||||
contains special characters). (Anatol)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #76296 (openssl_pkey_get_public does not respect open_basedir).
|
||||
(Erik Lax, Jakub Zelenka)
|
||||
. Fixed bug #76174 (openssl extension fails to build with LibreSSL 2.7).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #76367 (NoRewindIterator segfault 11). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76410 (SIGV in zend_mm_alloc_small). (Laruence)
|
||||
. Fixed bug #76335 ("link(): Bad file descriptor" with non-ASCII path).
|
||||
(Anatol)
|
||||
|
||||
24 May 2018, PHP 7.2.6
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #76164 (exif_read_data zend_mm_heap corrupted). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #76075 --with-fpm-acl wrongly tries to find libacl on FreeBSD.
|
||||
(mgorny)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74385 (Locale::parseLocale() broken with some arguments).
|
||||
(Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp). (Dmitry)
|
||||
. Fixed bug #76275 (Assertion failure in file cache when unserializing empty
|
||||
try_catch_array). (Nikita)
|
||||
. Fixed bug #76281 (Opcache causes incorrect "undefined variable" errors).
|
||||
(Nikita)
|
||||
|
||||
- Reflection:
|
||||
. Fixed arginfo of array_replace(_recursive) and array_merge(_recursive).
|
||||
(carusogabriel)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
|
||||
26 Apr 2018, PHP 7.2.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75722 (Convert valgrind detection to configure option).
|
||||
@@ -9,6 +61,10 @@ PHP NEWS
|
||||
- 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)
|
||||
@@ -18,9 +74,16 @@ PHP NEWS
|
||||
. Fixed bug #52070 (imagedashedline() - dashed line sometimes is not visible).
|
||||
(cmb)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #76249 (stream filter convert.iconv leads to infinite loop on
|
||||
invalid sequence). (Stas)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76153 (Intl compilation fails with icu4c 61.1). (Anatol)
|
||||
|
||||
- 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).
|
||||
@@ -33,6 +96,9 @@ PHP NEWS
|
||||
- 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)
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug 76337: segmentation fault when an extension use zend_register_class_alias() and opcache enabled
|
||||
--SKIPIF--
|
||||
<?php if (!class_exists('_ZendTestClass') || !extension_loaded('Zend OPcache')) die('skip');
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(class_exists('_ZendTestClassAlias'));
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #76383: array_map on $GLOBALS returns IS_INDIRECT
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 1;
|
||||
array_map(function($x) use (&$lastval) { $lastval = $x; }, $GLOBALS);
|
||||
var_dump(gettype($lastval), $lastval); // will contain $a
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(7) "integer"
|
||||
int(1)
|
||||
@@ -2785,6 +2785,7 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
|
||||
|
||||
zend_assert_valid_class_name(lcname);
|
||||
|
||||
lcname = zend_new_interned_string(lcname);
|
||||
ce = zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||
zend_string_release(lcname);
|
||||
if (ce) {
|
||||
@@ -2871,6 +2872,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {
|
||||
key = zend_string_alloc(class_name_length, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(key), class_name, class_name_length);
|
||||
disabled_class = zend_hash_find_ptr(CG(class_table), key);
|
||||
zend_string_release(key);
|
||||
if (!disabled_class) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=5
|
||||
PHP_RELEASE_VERSION=7
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
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`
|
||||
|
||||
@@ -6,6 +6,11 @@ if(!extension_loaded("bcmath")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip valid only for windows');
|
||||
}
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) >= 0) {
|
||||
echo "skip Only for Windows systems < $req";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -14,5 +19,4 @@ var_dump(bcpowmod(1, 1.2, 1, 1));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "1"
|
||||
string(3) "0.0"
|
||||
bc math warning: non-zero scale in exponent
|
||||
%Astring(3) "0.0"%A
|
||||
@@ -4,7 +4,11 @@ Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
|
||||
<?php
|
||||
if(!extension_loaded("bcmath")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip Not valid for windows');
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) < 0) {
|
||||
echo "skip Compatible on Windows systems >= $req";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -6,6 +6,11 @@ if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip valid only for windows');
|
||||
}
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) >= 0) {
|
||||
echo "skip Only for Windows systems < $req";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -13,9 +18,7 @@ var_dump(bcpowmod('4.1', '4', '3', 3));
|
||||
var_dump(bcpowmod('4', '4', '3.1', 3));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(5) "1.000"
|
||||
string(5) "1.000"
|
||||
===DONE===
|
||||
bc math warning: non-zero scale in base
|
||||
bc math warning: non-zero scale in modulus
|
||||
--EXPECTF--
|
||||
%Astring(5) "1.000"
|
||||
%Astring(5) "1.000"
|
||||
===DONE===%A
|
||||
@@ -4,7 +4,11 @@ Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip Not valid for windows');
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) < 0) {
|
||||
echo "skip Compatible on Windows systems >= $req";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -30,7 +30,8 @@ echo "Ok\n";
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
Hello World!
|
||||
Hello World!Ok
|
||||
%A
|
||||
Hello World!
|
||||
Hello World!* Closing connection 0
|
||||
Ok
|
||||
|
||||
@@ -65,4 +65,3 @@ Hello World!Ok for CURLOPT_FILE
|
||||
|
||||
%AOk for CURLOPT_INFILE
|
||||
===DONE===
|
||||
%A
|
||||
@@ -13,17 +13,23 @@ function curl_cli_server_start() {
|
||||
$doc_root = __DIR__;
|
||||
$router = "responder/get.php";
|
||||
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => array("pipe", "w"),
|
||||
);
|
||||
|
||||
$cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS;
|
||||
$cmd .= " {$router}";
|
||||
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
||||
} else {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
$cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS;
|
||||
$cmd .= " {$router}";
|
||||
$cmd .= " 2>/dev/null";
|
||||
|
||||
+1049
-1045
File diff suppressed because it is too large.
Load diff
@@ -719,7 +719,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
}
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
zval_ptr_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -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 */
|
||||
@@ -4457,13 +4457,11 @@ PHP_FUNCTION(exif_read_data)
|
||||
#ifdef EXIF_DEBUG
|
||||
sections_str = exif_get_sectionlist(sections_needed);
|
||||
if (!sections_str) {
|
||||
zend_string_release(z_sections_needed);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections needed: %s", sections_str[0] ? sections_str : "None");
|
||||
EFREE_IF(sections_str);
|
||||
#endif
|
||||
zend_string_release(z_sections_needed);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(stream) == IS_RESOURCE) {
|
||||
|
||||
@@ -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.
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76164 (exif_read_data zend_mm_heap corrupted)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$var1 = 'nonexistentfile';
|
||||
$var2 = 2200000000;
|
||||
@exif_read_data($var1, $var2); // we're not interested in the warning, here
|
||||
$var2 = 1;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -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,20 @@
|
||||
--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);
|
||||
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
|
||||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
|
||||
}
|
||||
$a = stream_get_contents($fh);
|
||||
var_dump(strlen($a));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
|
||||
int(3)
|
||||
DONE
|
||||
@@ -1082,6 +1082,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
|
||||
}
|
||||
}
|
||||
mail_free_errorlist(&IMAPG(imap_errorstack));
|
||||
IMAPG(imap_errorstack) = NIL;
|
||||
}
|
||||
|
||||
if (IMAPG(imap_alertstack) != NIL) {
|
||||
|
||||
@@ -79,6 +79,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if (U_FAILURE(status)) {
|
||||
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
|
||||
"create instance from compiled rules", 0);
|
||||
delete rbbi;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -103,19 +103,23 @@ typedef struct _intl_data {
|
||||
RETVAL_NEW_STR(u8str); \
|
||||
}
|
||||
|
||||
#define INTL_MAX_LOCALE_LEN 80
|
||||
#define INTL_MAX_LOCALE_LEN (ULOC_FULLNAME_CAPACITY-1)
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
return FAILURE; \
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -79,4 +79,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -76,4 +76,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -24,8 +24,17 @@ $rules = <<<RULES
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump(get_class($rbbi));
|
||||
|
||||
try {
|
||||
$obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
|
||||
} catch (IntlException $e) {
|
||||
var_dump(intl_get_error_code(), intl_get_error_message());
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
==DONE==
|
||||
int(1)
|
||||
string(93) "rbbi_create_instance: unable to create instance from compiled rules: U_ILLEGAL_ARGUMENT_ERROR"
|
||||
==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
|
||||
}
|
||||
}
|
||||
@@ -1020,6 +1020,11 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
|
||||
}
|
||||
if (i != j) {
|
||||
op_array->last_try_catch = j;
|
||||
if (j == 0) {
|
||||
efree(op_array->try_catch_array);
|
||||
op_array->try_catch_array = NULL;
|
||||
}
|
||||
|
||||
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
|
||||
zend_op *opline = new_opcodes;
|
||||
zend_op *end = opline + len;
|
||||
|
||||
@@ -171,12 +171,13 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa)
|
||||
while (i < end) {
|
||||
shiftlist[i] = i - target;
|
||||
if (EXPECTED(op_array->opcodes[i].opcode != ZEND_NOP) ||
|
||||
/*keep NOP to support ZEND_VM_SMART_BRANCH */
|
||||
(i > 0 &&
|
||||
/* Keep NOP to support ZEND_VM_SMART_BRANCH. Using "target-1" instead of
|
||||
* "i-1" here to check the last non-NOP instruction. */
|
||||
(target > 0 &&
|
||||
i + 1 < op_array->last &&
|
||||
(op_array->opcodes[i+1].opcode == ZEND_JMPZ ||
|
||||
op_array->opcodes[i+1].opcode == ZEND_JMPNZ) &&
|
||||
zend_is_smart_branch(op_array->opcodes + i - 1))) {
|
||||
zend_is_smart_branch(op_array->opcodes + target - 1))) {
|
||||
if (i != target) {
|
||||
op_array->opcodes[target] = op_array->opcodes[i];
|
||||
ssa->ops[target] = ssa->ops[i];
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #76275: Assertion failure in file cache when unserializing empty try_catch_array
|
||||
--INI--
|
||||
opcache.enabled=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_cache=/tmp
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (PHP_VERSION_ID >= 70000) {
|
||||
echo "Done";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_callable('random_bytes')) {
|
||||
try {
|
||||
} catch (com_exception $e) {
|
||||
}
|
||||
|
||||
function random_bytes($length)
|
||||
{
|
||||
throw new Exception(
|
||||
'There is no suitable CSPRNG installed on your system'
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #76281: Opcache causes incorrect "undefined variable" errors
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($r, $action) {
|
||||
$user_sub_resource = in_array($action, array('get_securityquestions', 'get_status', 'get_groupstats'));
|
||||
|
||||
$user_id = null;
|
||||
if ($user_sub_resource && isset($r['user_id'])) {
|
||||
$user_id = $r['user_id'];
|
||||
}
|
||||
else if (isset($r['id'])) {
|
||||
$user_id = $r['id'];
|
||||
}
|
||||
|
||||
if ($user_sub_resource) {
|
||||
return 'foo';
|
||||
}
|
||||
|
||||
return 'bar';
|
||||
}
|
||||
|
||||
var_dump(test(['user_id' => 1, 'id' => 2], 'foo'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -7,16 +7,22 @@ function php_cli_server_start($ini = "") {
|
||||
$php_executable = getenv('TEST_PHP_EXECUTABLE');
|
||||
$doc_root = __DIR__;
|
||||
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => array("pipe", "w"),
|
||||
);
|
||||
|
||||
$cmd = "{$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS;
|
||||
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
||||
} else {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
$cmd = "exec {$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS . " 2>/dev/null";
|
||||
$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,10 @@ static int zend_file_cache_flock(int fd, int type)
|
||||
|
||||
#define IS_SERIALIZED_INTERNED(ptr) \
|
||||
((size_t)(ptr) & Z_UL(1))
|
||||
|
||||
/* Allowing == here to account for a potential empty allocation at the end of the memory */
|
||||
#define IS_SERIALIZED(ptr) \
|
||||
((char*)(ptr) < (char*)script->size)
|
||||
((char*)(ptr) <= (char*)script->size)
|
||||
#define IS_UNSERIALIZED(ptr) \
|
||||
(((char*)(ptr) >= (char*)script->mem && (char*)(ptr) < (char*)script->mem + script->size) || \
|
||||
IS_ACCEL_INTERNED(ptr))
|
||||
@@ -533,14 +535,13 @@ static void zend_file_cache_serialize_prop_info(zval *zv,
|
||||
prop = Z_PTR_P(zv);
|
||||
UNSERIALIZE_PTR(prop);
|
||||
|
||||
if (prop->ce && !IS_SERIALIZED(prop->ce)) {
|
||||
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
|
||||
if (!IS_SERIALIZED(prop->ce)) {
|
||||
SERIALIZE_PTR(prop->ce);
|
||||
}
|
||||
if (prop->name && !IS_SERIALIZED(prop->name)) {
|
||||
SERIALIZE_STR(prop->name);
|
||||
}
|
||||
if (prop->doc_comment && !IS_SERIALIZED(prop->doc_comment)) {
|
||||
SERIALIZE_STR(prop->doc_comment);
|
||||
if (prop->doc_comment) {
|
||||
SERIALIZE_STR(prop->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -557,12 +558,15 @@ static void zend_file_cache_serialize_class_constant(zval *z
|
||||
c = Z_PTR_P(zv);
|
||||
UNSERIALIZE_PTR(c);
|
||||
|
||||
zend_file_cache_serialize_zval(&c->value, script, info, buf);
|
||||
if (c->ce && !IS_SERIALIZED(c->ce)) {
|
||||
ZEND_ASSERT(c->ce != NULL);
|
||||
if (!IS_SERIALIZED(c->ce)) {
|
||||
SERIALIZE_PTR(c->ce);
|
||||
}
|
||||
if (c->doc_comment && !IS_SERIALIZED(c->doc_comment)) {
|
||||
SERIALIZE_STR(c->doc_comment);
|
||||
|
||||
zend_file_cache_serialize_zval(&c->value, script, info, buf);
|
||||
|
||||
if (c->doc_comment) {
|
||||
SERIALIZE_STR(c->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1157,14 +1161,13 @@ static void zend_file_cache_unserialize_prop_info(zval *zv,
|
||||
UNSERIALIZE_PTR(Z_PTR_P(zv));
|
||||
prop = Z_PTR_P(zv);
|
||||
|
||||
if (prop->ce && !IS_UNSERIALIZED(prop->ce)) {
|
||||
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
|
||||
if (!IS_UNSERIALIZED(prop->ce)) {
|
||||
UNSERIALIZE_PTR(prop->ce);
|
||||
}
|
||||
if (prop->name && !IS_UNSERIALIZED(prop->name)) {
|
||||
UNSERIALIZE_STR(prop->name);
|
||||
}
|
||||
if (prop->doc_comment && !IS_UNSERIALIZED(prop->doc_comment)) {
|
||||
UNSERIALIZE_STR(prop->doc_comment);
|
||||
if (prop->doc_comment) {
|
||||
UNSERIALIZE_STR(prop->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1179,12 +1182,15 @@ static void zend_file_cache_unserialize_class_constant(zval *
|
||||
UNSERIALIZE_PTR(Z_PTR_P(zv));
|
||||
c = Z_PTR_P(zv);
|
||||
|
||||
zend_file_cache_unserialize_zval(&c->value, script, buf);
|
||||
if (c->ce && !IS_UNSERIALIZED(c->ce)) {
|
||||
ZEND_ASSERT(c->ce != NULL);
|
||||
if (!IS_UNSERIALIZED(c->ce)) {
|
||||
UNSERIALIZE_PTR(c->ce);
|
||||
}
|
||||
if (c->doc_comment && !IS_UNSERIALIZED(c->doc_comment)) {
|
||||
UNSERIALIZE_STR(c->doc_comment);
|
||||
|
||||
zend_file_cache_unserialize_zval(&c->value, script, buf);
|
||||
|
||||
if (c->doc_comment) {
|
||||
UNSERIALIZE_STR(c->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -72,7 +72,7 @@
|
||||
#ifdef HAVE_OPENSSL_MD2_H
|
||||
#define OPENSSL_ALGO_MD2 4
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
#define OPENSSL_ALGO_DSS1 5
|
||||
#endif
|
||||
#define OPENSSL_ALGO_SHA224 6
|
||||
@@ -566,7 +566,7 @@ ZEND_GET_MODULE(openssl)
|
||||
#endif
|
||||
|
||||
/* {{{ OpenSSL compatibility functions and macros */
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
#define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa
|
||||
#define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh
|
||||
#define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa
|
||||
@@ -683,7 +683,7 @@ static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
|
||||
return M_ASN1_STRING_data(asn1);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10002
|
||||
|
||||
static int X509_get_signature_nid(const X509 *x)
|
||||
{
|
||||
@@ -1243,7 +1243,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if defined(PHP_WIN32) || (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
#if defined(PHP_WIN32) || PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
#define PHP_OPENSSL_RAND_ADD_TIME() ((void) 0)
|
||||
#else
|
||||
#define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval()
|
||||
@@ -1330,7 +1330,7 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo) { /* {{{ */
|
||||
mdtype = (EVP_MD *) EVP_md2();
|
||||
break;
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
case OPENSSL_ALGO_DSS1:
|
||||
mdtype = (EVP_MD *) EVP_dss1();
|
||||
break;
|
||||
@@ -1461,7 +1461,7 @@ PHP_MINIT_FUNCTION(openssl)
|
||||
#ifdef HAVE_OPENSSL_MD2_H
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
|
||||
@@ -3644,7 +3644,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
/* Due to changes in OpenSSL 1.1 related to locking when decoding CSR,
|
||||
* the pub key is not changed after assigning. It means if we pass
|
||||
* a private key, it will be returned including the private part.
|
||||
@@ -3655,7 +3655,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
|
||||
/* Retrieve the public key from the CSR */
|
||||
tpubkey = X509_REQ_get_pubkey(csr);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
/* We need to free the CSR as it was duplicated */
|
||||
X509_REQ_free(csr);
|
||||
#endif
|
||||
@@ -3809,6 +3809,9 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
|
||||
if (Z_STRLEN_P(val) > 7 && memcmp(Z_STRVAL_P(val), "file://", sizeof("file://") - 1) == 0) {
|
||||
filename = Z_STRVAL_P(val) + (sizeof("file://") - 1);
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
}
|
||||
/* it's an X509 file/cert of some kind, and we need to extract the data from that */
|
||||
if (public_key) {
|
||||
@@ -3835,9 +3838,6 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
BIO *in;
|
||||
|
||||
if (filename) {
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
|
||||
@@ -29,6 +29,25 @@ extern zend_module_entry openssl_module_entry;
|
||||
#include "php_version.h"
|
||||
#define PHP_OPENSSL_VERSION PHP_VERSION
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#if defined(LIBRESSL_VERSION_NUMBER)
|
||||
/* LibreSSL version check */
|
||||
#if LIBRESSL_VERSION_NUMBER < 0x20700000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10001
|
||||
#else
|
||||
#define PHP_OPENSSL_API_VERSION 0x10100
|
||||
#endif
|
||||
#else
|
||||
/* OpenSSL version check */
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10002000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10001
|
||||
#elif OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10002
|
||||
#else
|
||||
#define PHP_OPENSSL_API_VERSION 0x10100
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define OPENSSL_RAW_DATA 1
|
||||
#define OPENSSL_ZERO_PADDING 2
|
||||
#define OPENSSL_DONT_ZERO_PAD_KEY 4
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #76296 openssl_pkey_get_public does not respect open_basedir
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dir = __DIR__ . '/bug76296_openbasedir';
|
||||
$pem = 'file://' . __DIR__ . '/public.key';
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir);
|
||||
}
|
||||
|
||||
ini_set('open_basedir', $dir);
|
||||
|
||||
var_dump(openssl_pkey_get_public($pem));
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: openssl_pkey_get_public(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d
|
||||
bool(false)
|
||||
--CLEAN--
|
||||
@rmdir(__DIR__ . '/bug76296_openbasedir');
|
||||
@@ -79,6 +79,9 @@ while (($enc_error_new = openssl_error_string()) !== false) {
|
||||
var_dump($error_queue_size);
|
||||
echo "\n";
|
||||
|
||||
$is_111 = OPENSSL_VERSION_NUMBER >= 0x10101000;
|
||||
$err_pem_no_start_line = $is_111 ? '0909006C': '0906D06C';
|
||||
|
||||
// PKEY
|
||||
echo "PKEY errors\n";
|
||||
// file for pkey (file:///) fails when opennig (BIO_new_file)
|
||||
@@ -86,7 +89,7 @@ echo "PKEY errors\n";
|
||||
expect_openssl_errors('openssl_pkey_export_to_file opening', ['02001002', '2006D080']);
|
||||
// file or private pkey is not correct PEM - failing PEM_read_bio_PrivateKey
|
||||
@openssl_pkey_export_to_file($csr_file, $output_file);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file pem', [$err_pem_no_start_line]);
|
||||
// file to export cannot be written
|
||||
@openssl_pkey_export_to_file($private_key_file, $invalid_file_for_write);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
|
||||
@@ -95,7 +98,7 @@ expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
|
||||
expect_openssl_errors('openssl_pkey_export', ['06065064', '0906A065']);
|
||||
// invalid x509 for getting public key
|
||||
@openssl_pkey_get_public($private_key_file);
|
||||
expect_openssl_errors('openssl_pkey_get_public', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_pkey_get_public', [$err_pem_no_start_line]);
|
||||
// private encrypt with unknown padding
|
||||
@openssl_private_encrypt("data", $crypted, $private_key_file, 1000);
|
||||
expect_openssl_errors('openssl_private_encrypt', ['04066076']);
|
||||
@@ -105,7 +108,7 @@ expect_openssl_errors('openssl_private_decrypt', ['04065072']);
|
||||
// public encrypt and decrypt with failed padding check and padding
|
||||
@openssl_public_encrypt("data", $crypted, $public_key_file, 1000);
|
||||
@openssl_public_decrypt("data", $crypted, $public_key_file);
|
||||
expect_openssl_errors('openssl_private_(en|de)crypt padding', ['0906D06C', '04068076', '04067072']);
|
||||
expect_openssl_errors('openssl_private_(en|de)crypt padding', [$err_pem_no_start_line, '04068076', '04067072']);
|
||||
|
||||
// X509
|
||||
echo "X509 errors\n";
|
||||
@@ -114,7 +117,7 @@ echo "X509 errors\n";
|
||||
expect_openssl_errors('openssl_x509_export_to_file open', ['02001002']);
|
||||
// file or str cert is not correct PEM - failing PEM_read_bio_X509 or PEM_ASN1_read_bio
|
||||
@openssl_x509_export_to_file($csr_file, $output_file);
|
||||
expect_openssl_errors('openssl_x509_export_to_file pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_x509_export_to_file pem', [$err_pem_no_start_line]);
|
||||
// file to export cannot be written
|
||||
@openssl_x509_export_to_file($crt_file, $invalid_file_for_write);
|
||||
expect_openssl_errors('openssl_x509_export_to_file write', ['2006D002']);
|
||||
@@ -129,7 +132,7 @@ echo "CSR errors\n";
|
||||
expect_openssl_errors('openssl_csr_get_subject open', ['02001002', '2006D080']);
|
||||
// file or str csr is not correct PEM - failing PEM_read_bio_X509_REQ
|
||||
@openssl_csr_get_subject($crt_file);
|
||||
expect_openssl_errors('openssl_csr_get_subjec pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_csr_get_subjec pem', [$err_pem_no_start_line]);
|
||||
|
||||
// other possible cuases that are difficult to catch:
|
||||
// - ASN1_STRING_to_UTF8 fails in add_assoc_name_entry
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
#define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) \
|
||||
ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i)))
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
static RSA *php_openssl_tmp_rsa_cb(SSL *s, int is_export, int keylength);
|
||||
#endif
|
||||
|
||||
@@ -1139,7 +1139,7 @@ static void php_openssl_init_server_reneg_limit(php_stream *stream, php_openssl_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
static RSA *php_openssl_tmp_rsa_cb(SSL *s, int is_export, int keylength)
|
||||
{
|
||||
BIGNUM *bn = NULL;
|
||||
@@ -1208,7 +1208,7 @@ static int php_openssl_set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /*
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
|
||||
#if defined(HAVE_ECDH) && PHP_OPENSSL_API_VERSION < 0x10100
|
||||
static int php_openssl_set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx) /* {{{ */
|
||||
{
|
||||
zval *zvcurve;
|
||||
@@ -1251,13 +1251,13 @@ static int php_openssl_set_server_specific_opts(php_stream *stream, SSL_CTX *ctx
|
||||
zval *zv;
|
||||
long ssl_ctx_options = SSL_CTX_get_options(ctx);
|
||||
|
||||
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
|
||||
#if defined(HAVE_ECDH) && PHP_OPENSSL_API_VERSION < 0x10100
|
||||
if (php_openssl_set_server_ecdh_curve(stream, ctx) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
SSL_CTX_set_tmp_rsa_callback(ctx, php_openssl_tmp_rsa_cb);
|
||||
#endif
|
||||
/* We now use php_openssl_tmp_rsa_cb to generate a key of appropriate size whenever necessary */
|
||||
|
||||
@@ -7,7 +7,12 @@ PDO_HEADER_FILES= \
|
||||
|
||||
|
||||
$(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
|
||||
(cd $(top_srcdir); $(RE2C) --no-generation-date -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re)
|
||||
@(cd $(top_srcdir); \
|
||||
if test -f ./pdo_sql_parser.re; then \
|
||||
$(RE2C) --no-generation-date -o pdo_sql_parser.c pdo_sql_parser.re; \
|
||||
else \
|
||||
$(RE2C) --no-generation-date -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re; \
|
||||
fi)
|
||||
|
||||
install-pdo-headers:
|
||||
@echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
|
||||
|
||||
+1
-1
@@ -1835,7 +1835,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
|
||||
char test[51];
|
||||
const char *pos;
|
||||
|
||||
if (ext_len >= 50) {
|
||||
if (ext_len < 0 || ext_len >= 50) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$2" = "" ]] || [[ "$3" = "" ]]; then
|
||||
echo "Usage: $0 BASE_DIRECTORY DEPTH HASH_BITS"
|
||||
echo "Usage: $0 BASE_DIRECTORY DEPTH BITS_PER_CHAR"
|
||||
echo "BASE_DIRECTORY will be created if it doesn't exist"
|
||||
echo "DEPTH must be an integer number >0"
|
||||
echo "HASH_BITS(session.hash_bits_per_character) should be one of 4, 5, or 6"
|
||||
echo "BITS_PER_CHAR(session.sid_bits_per_character) should be one of 4, 5, or 6."
|
||||
# http://php.net/manual/en/session.configuration.php#ini.session.sid-bits-per-character
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -18,15 +19,15 @@ fi
|
||||
|
||||
directory="$1"
|
||||
depth="$2"
|
||||
hashbits="$3"
|
||||
bitsperchar="$3"
|
||||
|
||||
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
|
||||
|
||||
if [[ "$hashbits" -ge "5" ]]; then
|
||||
if [[ "$bitsperchar" -ge "5" ]]; then
|
||||
hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
|
||||
fi
|
||||
|
||||
if [[ "$hashbits" -ge "6" ]]; then
|
||||
if [[ "$bitsperchar" -ge "6" ]]; then
|
||||
hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
|
||||
fi
|
||||
|
||||
@@ -56,10 +57,10 @@ if [[ ! -d $directory ]]; then
|
||||
fi
|
||||
|
||||
|
||||
echo "Creating session path in $directory with a depth of $depth for session.hash_bits_per_character = $hashbits"
|
||||
echo "Creating session path in $directory with a depth of $depth for session.sid_bits_per_character = $bitsperchar"
|
||||
|
||||
for i in $hash_chars; do
|
||||
newpath="$directory/$i"
|
||||
mkdir $newpath || exit 1
|
||||
bash $0 $newpath `expr $depth - 1` $hashbits recurse
|
||||
bash $0 $newpath `expr $depth - 1` $bitsperchar recurse
|
||||
done
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #74892 Url Rewriting (trans_sid) not working on urls that start with #
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('session.use_cookies', '0');
|
||||
ini_set('session.use_only_cookies',0);
|
||||
ini_set('session.use_trans_sid',1);
|
||||
ini_set('session.trans_sid_hosts','php.net');
|
||||
session_id('sessionidhere');
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<p><a href="index.php">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
+21
-21
@@ -1299,11 +1299,11 @@ PHP_FUNCTION(socket_getsockname)
|
||||
case AF_INET6:
|
||||
sin6 = (struct sockaddr_in6 *) sa;
|
||||
inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN);
|
||||
zval_dtor(addr);
|
||||
zval_ptr_dtor(addr);
|
||||
ZVAL_STRING(addr, addr6);
|
||||
|
||||
if (port != NULL) {
|
||||
zval_dtor(port);
|
||||
zval_ptr_dtor(port);
|
||||
ZVAL_LONG(port, htons(sin6->sin6_port));
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1316,11 +1316,11 @@ PHP_FUNCTION(socket_getsockname)
|
||||
addr_string = inet_ntoa(sin->sin_addr);
|
||||
inet_ntoa_lock = 0;
|
||||
|
||||
zval_dtor(addr);
|
||||
zval_ptr_dtor(addr);
|
||||
ZVAL_STRING(addr, addr_string);
|
||||
|
||||
if (port != NULL) {
|
||||
zval_dtor(port);
|
||||
zval_ptr_dtor(port);
|
||||
ZVAL_LONG(port, htons(sin->sin_port));
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1329,7 +1329,7 @@ PHP_FUNCTION(socket_getsockname)
|
||||
case AF_UNIX:
|
||||
s_un = (struct sockaddr_un *) sa;
|
||||
|
||||
zval_dtor(addr);
|
||||
zval_ptr_dtor(addr);
|
||||
ZVAL_STRING(addr, s_un->sun_path);
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
@@ -1378,11 +1378,11 @@ PHP_FUNCTION(socket_getpeername)
|
||||
case AF_INET6:
|
||||
sin6 = (struct sockaddr_in6 *) sa;
|
||||
inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN);
|
||||
zval_dtor(arg2);
|
||||
zval_ptr_dtor(arg2);
|
||||
ZVAL_STRING(arg2, addr6);
|
||||
|
||||
if (arg3 != NULL) {
|
||||
zval_dtor(arg3);
|
||||
zval_ptr_dtor(arg3);
|
||||
ZVAL_LONG(arg3, htons(sin6->sin6_port));
|
||||
}
|
||||
|
||||
@@ -1396,11 +1396,11 @@ PHP_FUNCTION(socket_getpeername)
|
||||
addr_string = inet_ntoa(sin->sin_addr);
|
||||
inet_ntoa_lock = 0;
|
||||
|
||||
zval_dtor(arg2);
|
||||
zval_ptr_dtor(arg2);
|
||||
ZVAL_STRING(arg2, addr_string);
|
||||
|
||||
if (arg3 != NULL) {
|
||||
zval_dtor(arg3);
|
||||
zval_ptr_dtor(arg3);
|
||||
ZVAL_LONG(arg3, htons(sin->sin_port));
|
||||
}
|
||||
|
||||
@@ -1410,7 +1410,7 @@ PHP_FUNCTION(socket_getpeername)
|
||||
case AF_UNIX:
|
||||
s_un = (struct sockaddr_un *) sa;
|
||||
|
||||
zval_dtor(arg2);
|
||||
zval_ptr_dtor(arg2);
|
||||
ZVAL_STRING(arg2, s_un->sun_path);
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
@@ -1683,14 +1683,14 @@ PHP_FUNCTION(socket_recv)
|
||||
if ((retval = recv(php_sock->bsd_socket, ZSTR_VAL(recv_buf), len, flags)) < 1) {
|
||||
zend_string_free(recv_buf);
|
||||
|
||||
zval_dtor(buf);
|
||||
zval_ptr_dtor(buf);
|
||||
ZVAL_NULL(buf);
|
||||
} else {
|
||||
ZSTR_LEN(recv_buf) = retval;
|
||||
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
|
||||
|
||||
/* Rebuild buffer zval */
|
||||
zval_dtor(buf);
|
||||
zval_ptr_dtor(buf);
|
||||
ZVAL_NEW_STR(buf, recv_buf);
|
||||
}
|
||||
|
||||
@@ -1779,8 +1779,8 @@ PHP_FUNCTION(socket_recvfrom)
|
||||
ZSTR_LEN(recv_buf) = retval;
|
||||
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
|
||||
|
||||
zval_dtor(arg2);
|
||||
zval_dtor(arg5);
|
||||
zval_ptr_dtor(arg2);
|
||||
zval_ptr_dtor(arg5);
|
||||
|
||||
ZVAL_NEW_STR(arg2, recv_buf);
|
||||
ZVAL_STRING(arg5, s_un.sun_path);
|
||||
@@ -1806,9 +1806,9 @@ PHP_FUNCTION(socket_recvfrom)
|
||||
ZSTR_LEN(recv_buf) = retval;
|
||||
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
|
||||
|
||||
zval_dtor(arg2);
|
||||
zval_dtor(arg5);
|
||||
zval_dtor(arg6);
|
||||
zval_ptr_dtor(arg2);
|
||||
zval_ptr_dtor(arg5);
|
||||
zval_ptr_dtor(arg6);
|
||||
|
||||
address = inet_ntoa(sin.sin_addr);
|
||||
|
||||
@@ -1837,9 +1837,9 @@ PHP_FUNCTION(socket_recvfrom)
|
||||
ZSTR_LEN(recv_buf) = retval;
|
||||
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
|
||||
|
||||
zval_dtor(arg2);
|
||||
zval_dtor(arg5);
|
||||
zval_dtor(arg6);
|
||||
zval_ptr_dtor(arg2);
|
||||
zval_ptr_dtor(arg5);
|
||||
zval_ptr_dtor(arg6);
|
||||
|
||||
memset(addr6, 0, INET6_ADDRSTRLEN);
|
||||
inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN);
|
||||
@@ -2232,7 +2232,7 @@ PHP_FUNCTION(socket_create_pair)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
zval_dtor(fds_array_zval);
|
||||
zval_ptr_dtor(fds_array_zval);
|
||||
array_init(fds_array_zval);
|
||||
|
||||
php_sock[0]->bsd_socket = fds_array[0];
|
||||
|
||||
@@ -11,6 +11,9 @@ die('skip not for Microsoft Windows');
|
||||
if (strtolower(substr(PHP_OS, 0, 3)) == 'aix') {
|
||||
die('skip not for AIX');
|
||||
}
|
||||
if (!defined('SO_PASSCRED')) {
|
||||
die('skip SO_PASSCRED is not defined');
|
||||
}
|
||||
--CLEAN--
|
||||
<?php
|
||||
$path = __DIR__ . "/unix_sock";
|
||||
|
||||
+1
-1
@@ -1039,7 +1039,7 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */
|
||||
return zend_user_it_get_current_data(iter);
|
||||
} else {
|
||||
zval *data = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, object));
|
||||
if (Z_TYPE_P(data) == IS_INDIRECT) {
|
||||
if (data && Z_TYPE_P(data) == IS_INDIRECT) {
|
||||
data = Z_INDIRECT_P(data);
|
||||
}
|
||||
return data;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76367 (NoRewindIterator segfault 11)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [1,3,55,66,43,6];
|
||||
|
||||
$iter = new NoRewindIterator(new ArrayIterator($arr));
|
||||
|
||||
while($iter->valid()) {
|
||||
$iter->next();
|
||||
}
|
||||
|
||||
var_dump($iter->current());
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
+28
-10
@@ -2533,7 +2533,13 @@ PHP_FUNCTION(extract)
|
||||
count = php_extract_if_exists(Z_ARRVAL_P(var_array_param), symbol_table);
|
||||
break;
|
||||
case EXTR_OVERWRITE:
|
||||
count = php_extract_overwrite(Z_ARRVAL_P(var_array_param), symbol_table);
|
||||
{
|
||||
zval zv;
|
||||
/* The array might be stored in a local variable that will be overwritten */
|
||||
ZVAL_COPY(&zv, var_array_param);
|
||||
count = php_extract_overwrite(Z_ARRVAL(zv), symbol_table);
|
||||
zval_ptr_dtor(&zv);
|
||||
}
|
||||
break;
|
||||
case EXTR_PREFIX_IF_EXISTS:
|
||||
count = php_extract_prefix_if_exists(Z_ARRVAL_P(var_array_param), symbol_table, prefix);
|
||||
@@ -2769,10 +2775,18 @@ PHP_FUNCTION(range)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
|
||||
if (zstep) {
|
||||
if (Z_TYPE_P(zstep) == IS_DOUBLE ||
|
||||
(Z_TYPE_P(zstep) == IS_STRING && is_numeric_string(Z_STRVAL_P(zstep), Z_STRLEN_P(zstep), NULL, NULL, 0) == IS_DOUBLE)
|
||||
) {
|
||||
if (Z_TYPE_P(zstep) == IS_DOUBLE) {
|
||||
is_step_double = 1;
|
||||
} else if (Z_TYPE_P(zstep) == IS_STRING) {
|
||||
int type = is_numeric_string(Z_STRVAL_P(zstep), Z_STRLEN_P(zstep), NULL, NULL, 0);
|
||||
if (type == IS_DOUBLE) {
|
||||
is_step_double = 1;
|
||||
}
|
||||
if (type == 0) {
|
||||
/* bad number */
|
||||
php_error_docref(NULL, E_WARNING, "Invalid range string - must be numeric");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
step = zval_get_double(zstep);
|
||||
@@ -2900,6 +2914,10 @@ long_str:
|
||||
}
|
||||
|
||||
lstep = step;
|
||||
if (step <= 0) {
|
||||
err = 1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
Z_TYPE_INFO(tmp) = IS_LONG;
|
||||
if (low > high) { /* Negative steps */
|
||||
@@ -3897,7 +3915,7 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array array_merge(array arr1, array arr2 [, array ...])
|
||||
/* {{{ proto array array_merge(array arr1 [, array ...])
|
||||
Merges elements from passed arrays into one array */
|
||||
PHP_FUNCTION(array_merge)
|
||||
{
|
||||
@@ -3905,7 +3923,7 @@ PHP_FUNCTION(array_merge)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array array_merge_recursive(array arr1, array arr2 [, array ...])
|
||||
/* {{{ proto array array_merge_recursive(array arr1 [, array ...])
|
||||
Recursively merges elements from passed arrays into one array */
|
||||
PHP_FUNCTION(array_merge_recursive)
|
||||
{
|
||||
@@ -3913,7 +3931,7 @@ PHP_FUNCTION(array_merge_recursive)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array array_replace(array arr1, array arr2 [, array ...])
|
||||
/* {{{ proto array array_replace(array arr1 [, array ...])
|
||||
Replaces elements from passed arrays into one array */
|
||||
PHP_FUNCTION(array_replace)
|
||||
{
|
||||
@@ -3921,7 +3939,7 @@ PHP_FUNCTION(array_replace)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array array_replace_recursive(array arr1, array arr2 [, array ...])
|
||||
/* {{{ proto array array_replace_recursive(array arr1 [, array ...])
|
||||
Recursively replaces elements from passed arrays into one array */
|
||||
PHP_FUNCTION(array_replace_recursive)
|
||||
{
|
||||
@@ -4829,7 +4847,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
|
||||
ZVAL_UNDEF(&list->val);
|
||||
if (hash->nNumOfElements > 1) {
|
||||
if (behavior == INTERSECT_NORMAL) {
|
||||
zend_sort((void *) lists[i], hash->nNumOfElements,
|
||||
zend_sort((void *) lists[i], hash->nNumOfElements,
|
||||
sizeof(Bucket), intersect_data_compare_func, (swap_func_t)zend_hash_bucket_swap);
|
||||
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
|
||||
zend_sort((void *) lists[i], hash->nNumOfElements,
|
||||
@@ -6080,7 +6098,7 @@ PHP_FUNCTION(array_map)
|
||||
|
||||
array_init_size(return_value, maxlen);
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(arrays[0]), num_key, str_key, zv) {
|
||||
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL(arrays[0]), num_key, str_key, zv) {
|
||||
fci.retval = &result;
|
||||
fci.param_count = 1;
|
||||
fci.params = &arg;
|
||||
|
||||
@@ -391,22 +391,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, preserve_keys)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
||||
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
||||
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
||||
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
||||
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -4040,7 +4040,7 @@ PHP_FUNCTION(long2ip)
|
||||
********************/
|
||||
|
||||
/* {{{ proto string getenv(string varname[, bool local_only]
|
||||
Get the value of an environment variable or every available environment variable
|
||||
Get the value of an environment variable or every available environment variable
|
||||
if no varname is present */
|
||||
PHP_FUNCTION(getenv)
|
||||
{
|
||||
|
||||
@@ -318,7 +318,7 @@ case "$PHP_SAPI" in
|
||||
none)
|
||||
for PROG in $PHP_BINARIES; do
|
||||
case "$PROG" in
|
||||
cgi|cli)
|
||||
cgi|cli|phpdbg)
|
||||
PHP_ENABLE_CHROOT_FUNC=yes
|
||||
;;
|
||||
|
||||
|
||||
@@ -196,6 +196,7 @@ PHP_FUNCTION(link)
|
||||
int ret;
|
||||
char source_p[MAXPATHLEN];
|
||||
char dest_p[MAXPATHLEN];
|
||||
wchar_t *dstw, *srcw;
|
||||
|
||||
/*First argument to link function is the target and hence should go to frompath
|
||||
Second argument to link function is the link itself and hence should go to topath */
|
||||
@@ -224,16 +225,38 @@ PHP_FUNCTION(link)
|
||||
}
|
||||
|
||||
#ifndef ZTS
|
||||
ret = CreateHardLinkA(topath, frompath, NULL);
|
||||
# define _TO_PATH topath
|
||||
# define _FROM_PATH frompath
|
||||
#else
|
||||
ret = CreateHardLinkA(dest_p, source_p, NULL);
|
||||
# define _TO_PATH dest_p
|
||||
# define _FROM_PATH source_p
|
||||
#endif
|
||||
dstw = php_win32_ioutil_any_to_w(_TO_PATH);
|
||||
if (!dstw) {
|
||||
php_error_docref(NULL, E_WARNING, "UTF-16 conversion failed (error %d)", GetLastError());
|
||||
RETURN_FALSE;
|
||||
}
|
||||
srcw = php_win32_ioutil_any_to_w(_FROM_PATH);
|
||||
if (!srcw) {
|
||||
free(dstw);
|
||||
php_error_docref(NULL, E_WARNING, "UTF-16 conversion failed (error %d)", GetLastError());
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#undef _TO_PATH
|
||||
#undef _FROM_PATH
|
||||
|
||||
ret = CreateHardLinkW(dstw, srcw, NULL);
|
||||
|
||||
if (ret == 0) {
|
||||
free(dstw);
|
||||
free(srcw);
|
||||
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
free(dstw);
|
||||
free(srcw);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -27,6 +27,8 @@ var_dump( range(1) ); // No.of args < expected
|
||||
var_dump( range(1,2,3,4) ); // No.of args > expected
|
||||
var_dump( range(-1, -2, 2) );
|
||||
var_dump( range("a", "j", "z") );
|
||||
var_dump( range(0, 1, "140962482048819216326.24") );
|
||||
var_dump( range(0, 1, "140962482048819216326.24.") );
|
||||
|
||||
echo "\n-- Testing Invalid steps --";
|
||||
$step_arr = array( "string", NULL, FALSE, "", "\0" );
|
||||
@@ -78,11 +80,17 @@ bool(false)
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): Invalid range string - must be numeric in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): Invalid range string - must be numeric in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing Invalid steps --
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
Warning: range(): Invalid range string - must be numeric in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
@@ -91,9 +99,9 @@ bool(false)
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
Warning: range(): Invalid range string - must be numeric in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: range(): step exceeds the specified range in %s on line %d
|
||||
Warning: range(): Invalid range string - must be numeric in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
Bug #76335 "link(): Bad file descriptor" with non-ASCII path
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$d0 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "á";
|
||||
$d1 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "a";
|
||||
|
||||
$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "file";
|
||||
|
||||
$l0 = $d0 . DIRECTORY_SEPARATOR . "b";
|
||||
$l1 = $d1 . DIRECTORY_SEPARATOR . "b";
|
||||
|
||||
mkdir($d0);
|
||||
mkdir($d1);
|
||||
|
||||
file_put_contents($fn, "");
|
||||
|
||||
chdir($d0);
|
||||
var_dump(link($d0 . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "file", $l0));
|
||||
|
||||
chdir($d1);
|
||||
var_dump(link($d1 . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "file", $l1));
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
|
||||
$d0 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "á";
|
||||
$d1 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "a";
|
||||
|
||||
$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "file";
|
||||
|
||||
$l0 = $d0 . DIRECTORY_SEPARATOR . "b";
|
||||
$l1 = $d1 . DIRECTORY_SEPARATOR . "b";
|
||||
|
||||
unlink($l0);
|
||||
unlink($l1);
|
||||
unlink($fn);
|
||||
rmdir($d0);
|
||||
rmdir($d1);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
@@ -194,6 +194,13 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't modify URLs of the format "#mark" */
|
||||
if (url_parts->fragment && '#' == ZSTR_VAL(url->s)[0]) {
|
||||
smart_str_append_smart_str(dest, url);
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check protocol. Only http/https is allowed. */
|
||||
if (url_parts->scheme
|
||||
&& strcasecmp("http", url_parts->scheme)
|
||||
@@ -217,13 +224,12 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
* When URL does not have path and query string add "/?".
|
||||
* i.e. If URL is only "?foo=bar", should not add "/?".
|
||||
*/
|
||||
if (!url_parts->path && !url_parts->query) {
|
||||
if (!url_parts->path && !url_parts->query && !url_parts->fragment) {
|
||||
/* URL is http://php.net or like */
|
||||
smart_str_append_smart_str(dest, url);
|
||||
smart_str_appendc(dest, '/');
|
||||
smart_str_appendc(dest, '?');
|
||||
smart_str_append_smart_str(dest, url_app);
|
||||
/* There should not be fragment. Just return */
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
@@ -513,7 +519,7 @@ state_plain_begin:
|
||||
state_plain:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 517 "ext/standard/url_scanner_ex.c"
|
||||
#line 523 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -563,22 +569,22 @@ yy2:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy2;
|
||||
}
|
||||
#line 520 "ext/standard/url_scanner_ex.re"
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain; }
|
||||
#line 569 "ext/standard/url_scanner_ex.c"
|
||||
#line 575 "ext/standard/url_scanner_ex.c"
|
||||
yy5:
|
||||
++YYCURSOR;
|
||||
#line 519 "ext/standard/url_scanner_ex.re"
|
||||
#line 525 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
|
||||
#line 574 "ext/standard/url_scanner_ex.c"
|
||||
#line 580 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 521 "ext/standard/url_scanner_ex.re"
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_tag:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 582 "ext/standard/url_scanner_ex.c"
|
||||
#line 588 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -621,9 +627,9 @@ state_tag:
|
||||
goto yy11;
|
||||
}
|
||||
++YYCURSOR;
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
#line 533 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 627 "ext/standard/url_scanner_ex.c"
|
||||
#line 633 "ext/standard/url_scanner_ex.c"
|
||||
yy11:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -631,11 +637,11 @@ yy11:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy11;
|
||||
}
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
#line 532 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
|
||||
#line 637 "ext/standard/url_scanner_ex.c"
|
||||
#line 643 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 528 "ext/standard/url_scanner_ex.re"
|
||||
#line 534 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_next_arg_begin:
|
||||
@@ -644,7 +650,7 @@ state_next_arg_begin:
|
||||
state_next_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 648 "ext/standard/url_scanner_ex.c"
|
||||
#line 654 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -700,9 +706,9 @@ state_next_arg:
|
||||
yy16:
|
||||
++YYCURSOR;
|
||||
yy17:
|
||||
#line 539 "ext/standard/url_scanner_ex.re"
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 706 "ext/standard/url_scanner_ex.c"
|
||||
#line 712 "ext/standard/url_scanner_ex.c"
|
||||
yy18:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -710,30 +716,30 @@ yy18:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy18;
|
||||
}
|
||||
#line 537 "ext/standard/url_scanner_ex.re"
|
||||
#line 543 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg; }
|
||||
#line 716 "ext/standard/url_scanner_ex.c"
|
||||
#line 722 "ext/standard/url_scanner_ex.c"
|
||||
yy21:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '>') goto yy17;
|
||||
yy22:
|
||||
++YYCURSOR;
|
||||
#line 536 "ext/standard/url_scanner_ex.re"
|
||||
#line 542 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
|
||||
#line 724 "ext/standard/url_scanner_ex.c"
|
||||
#line 730 "ext/standard/url_scanner_ex.c"
|
||||
yy24:
|
||||
++YYCURSOR;
|
||||
#line 538 "ext/standard/url_scanner_ex.re"
|
||||
#line 544 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
|
||||
#line 729 "ext/standard/url_scanner_ex.c"
|
||||
#line 735 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 540 "ext/standard/url_scanner_ex.re"
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 737 "ext/standard/url_scanner_ex.c"
|
||||
#line 743 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -778,9 +784,9 @@ state_arg:
|
||||
if (yych <= 'z') goto yy30;
|
||||
yy28:
|
||||
++YYCURSOR;
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
|
||||
#line 784 "ext/standard/url_scanner_ex.c"
|
||||
#line 790 "ext/standard/url_scanner_ex.c"
|
||||
yy30:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -788,17 +794,17 @@ yy30:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy30;
|
||||
}
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
#line 551 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
|
||||
#line 794 "ext/standard/url_scanner_ex.c"
|
||||
#line 800 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 547 "ext/standard/url_scanner_ex.re"
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_before_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 802 "ext/standard/url_scanner_ex.c"
|
||||
#line 808 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -841,9 +847,9 @@ state_before_val:
|
||||
if (yych == '=') goto yy38;
|
||||
++YYCURSOR;
|
||||
yy36:
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
#line 559 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; goto state_next_arg_begin; }
|
||||
#line 847 "ext/standard/url_scanner_ex.c"
|
||||
#line 853 "ext/standard/url_scanner_ex.c"
|
||||
yy37:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ' ') goto yy41;
|
||||
@@ -855,9 +861,9 @@ yy38:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy38;
|
||||
}
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
#line 558 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
|
||||
#line 861 "ext/standard/url_scanner_ex.c"
|
||||
#line 867 "ext/standard/url_scanner_ex.c"
|
||||
yy41:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -867,14 +873,14 @@ yy41:
|
||||
YYCURSOR = YYMARKER;
|
||||
goto yy36;
|
||||
}
|
||||
#line 554 "ext/standard/url_scanner_ex.re"
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
|
||||
state_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 878 "ext/standard/url_scanner_ex.c"
|
||||
#line 884 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -927,15 +933,15 @@ yy46:
|
||||
if (yybm[0+yych] & 32) {
|
||||
goto yy46;
|
||||
}
|
||||
#line 562 "ext/standard/url_scanner_ex.re"
|
||||
#line 568 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
|
||||
#line 933 "ext/standard/url_scanner_ex.c"
|
||||
#line 939 "ext/standard/url_scanner_ex.c"
|
||||
yy49:
|
||||
++YYCURSOR;
|
||||
yy50:
|
||||
#line 563 "ext/standard/url_scanner_ex.re"
|
||||
#line 569 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg_begin; }
|
||||
#line 939 "ext/standard/url_scanner_ex.c"
|
||||
#line 945 "ext/standard/url_scanner_ex.c"
|
||||
yy51:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == '>') goto yy50;
|
||||
@@ -958,9 +964,9 @@ yy55:
|
||||
goto yy50;
|
||||
yy56:
|
||||
++YYCURSOR;
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
#line 566 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
|
||||
#line 964 "ext/standard/url_scanner_ex.c"
|
||||
#line 970 "ext/standard/url_scanner_ex.c"
|
||||
yy58:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -971,11 +977,11 @@ yy59:
|
||||
}
|
||||
if (yych >= '(') goto yy55;
|
||||
++YYCURSOR;
|
||||
#line 561 "ext/standard/url_scanner_ex.re"
|
||||
#line 567 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
|
||||
#line 977 "ext/standard/url_scanner_ex.c"
|
||||
#line 983 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 564 "ext/standard/url_scanner_ex.re"
|
||||
#line 570 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
stop:
|
||||
|
||||
@@ -197,6 +197,13 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't modify URLs of the format "#mark" */
|
||||
if (url_parts->fragment && '#' == ZSTR_VAL(url->s)[0]) {
|
||||
smart_str_append_smart_str(dest, url);
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check protocol. Only http/https is allowed. */
|
||||
if (url_parts->scheme
|
||||
&& strcasecmp("http", url_parts->scheme)
|
||||
@@ -220,13 +227,12 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
* When URL does not have path and query string add "/?".
|
||||
* i.e. If URL is only "?foo=bar", should not add "/?".
|
||||
*/
|
||||
if (!url_parts->path && !url_parts->query) {
|
||||
if (!url_parts->path && !url_parts->query && !url_parts->fragment) {
|
||||
/* URL is http://php.net or like */
|
||||
smart_str_append_smart_str(dest, url);
|
||||
smart_str_appendc(dest, '/');
|
||||
smart_str_appendc(dest, '?');
|
||||
smart_str_append_smart_str(dest, url_app);
|
||||
/* There should not be fragment. Just return */
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,6 +200,8 @@ PHP_MINIT_FUNCTION(zend_test)
|
||||
zend_test_trait = zend_register_internal_class(&class_entry);
|
||||
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
|
||||
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
|
||||
|
||||
zend_register_class_alias("_ZendTestClassAlias", zend_test_class);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ if (PHP_ZIP != "no") {
|
||||
) {
|
||||
EXTENSION('zip', 'php_zip.c zip_stream.c');
|
||||
|
||||
if (!PHP_ZIP_SHARED) {
|
||||
if (get_define("LIBS_ZIP").match("libzip_a.lib")) {
|
||||
/* Using static dependency lib. */
|
||||
AC_DEFINE("ZIP_STATIC", 1);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
/* edit configure.ac to change version number */
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 2
|
||||
#define PHP_RELEASE_VERSION 5
|
||||
#define PHP_RELEASE_VERSION 7
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.2.5-dev"
|
||||
#define PHP_VERSION_ID 70205
|
||||
#define PHP_VERSION "7.2.7-dev"
|
||||
#define PHP_VERSION_ID 70207
|
||||
@@ -1879,6 +1879,10 @@ ldap.max_links = -1
|
||||
; Prevent name collisions in chroot'ed environment.
|
||||
;opcache.validate_root=0
|
||||
|
||||
; If specified, it produces opcode dumps for debugging different stages of
|
||||
; optimizations.
|
||||
;opcache.opt_debug_level=0
|
||||
|
||||
[curl]
|
||||
; A default value for the CURLOPT_CAINFO option. This is required to be an
|
||||
; absolute path.
|
||||
|
||||
@@ -1886,6 +1886,10 @@ ldap.max_links = -1
|
||||
; Prevent name collisions in chroot'ed environment.
|
||||
;opcache.validate_root=0
|
||||
|
||||
; If specified, it produces opcode dumps for debugging different stages of
|
||||
; optimizations.
|
||||
;opcache.opt_debug_level=0
|
||||
|
||||
[curl]
|
||||
; A default value for the CURLOPT_CAINFO option. This is required to be an
|
||||
; absolute path.
|
||||
|
||||
@@ -2013,9 +2013,11 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
|
||||
' ' == client->request.path_translated[client->request.path_translated_len-1])) {
|
||||
return php_cli_server_send_error_page(server, client, 500);
|
||||
}
|
||||
#endif
|
||||
|
||||
fd = client->request.path_translated ? php_win32_ioutil_open(client->request.path_translated, O_RDONLY): -1;
|
||||
#else
|
||||
fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1;
|
||||
#endif
|
||||
if (fd < 0) {
|
||||
return php_cli_server_send_error_page(server, client, 404);
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ function php_cli_server_start($code = 'echo "Hello world";', $router = 'index.ph
|
||||
file_put_contents($doc_root . '/' . ($router ?: 'index.php'), '<?php ' . $code . ' ?>');
|
||||
}
|
||||
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => array("pipe", "w"),
|
||||
);
|
||||
|
||||
$cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
||||
if (!is_null($router)) {
|
||||
$cmd .= " {$router}";
|
||||
@@ -25,6 +25,12 @@ function php_cli_server_start($code = 'echo "Hello world";', $router = 'index.ph
|
||||
|
||||
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
||||
} else {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
$cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
||||
if (!is_null($router)) {
|
||||
$cmd .= " {$router}";
|
||||
|
||||
+8
-3
@@ -630,11 +630,16 @@ if test "$PHP_FPM" != "no"; then
|
||||
|
||||
if test "$PHP_FPM_ACL" != "no" ; then
|
||||
AC_CHECK_HEADERS([sys/acl.h])
|
||||
AC_CHECK_LIB(acl, acl_free, [
|
||||
PHP_ADD_LIBRARY(acl)
|
||||
dnl *BSD has acl_* built into libc
|
||||
AC_CHECK_FUNC(acl_free, [
|
||||
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
|
||||
],[
|
||||
AC_MSG_ERROR(libacl required not found)
|
||||
AC_CHECK_LIB(acl, acl_free, [
|
||||
PHP_ADD_LIBRARY(acl)
|
||||
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
|
||||
],[
|
||||
AC_MSG_ERROR(libacl required not found)
|
||||
])
|
||||
])
|
||||
fi
|
||||
|
||||
|
||||
@@ -1116,7 +1116,7 @@ const char phpdbg_ini_hardcoded[] =
|
||||
|
||||
/* overwriteable ini defaults must be set in phpdbg_ini_defaults() */
|
||||
#define INI_DEFAULT(name, value) \
|
||||
ZVAL_STRINGL(&tmp, value, sizeof(value) - 1); \
|
||||
ZVAL_NEW_STR(&tmp, zend_string_init(value, sizeof(value) - 1, 1)); \
|
||||
zend_hash_str_update(configuration_hash, name, sizeof(name) - 1, &tmp);
|
||||
|
||||
void phpdbg_ini_defaults(HashTable *configuration_hash) /* {{{ */
|
||||
@@ -1805,6 +1805,11 @@ phpdbg_main:
|
||||
|
||||
if (php_request_startup() == FAILURE) {
|
||||
PUTS("Could not startup");
|
||||
#ifndef _WIN32
|
||||
if (address) {
|
||||
free(address);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3137,6 +3137,10 @@ function toolset_setup_common_cflags()
|
||||
}
|
||||
}
|
||||
|
||||
if (VCVERS >= 1914) {
|
||||
/* This is only in effect for CXX sources, __cplusplus is not defined in C sources. */
|
||||
ADD_FLAG("CFLAGS", "/Zc:__cplusplus");
|
||||
}
|
||||
} else if (CLANG_TOOLSET) {
|
||||
if (X64) {
|
||||
ADD_FLAG('CFLAGS', '-m64');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
bz2-1.0.6
|
||||
cclient-2007f
|
||||
freetype-2.8.1
|
||||
icu-57.1
|
||||
icu-61.1
|
||||
jpeglib-9b
|
||||
libcurl-7.59.0
|
||||
libiconv-1.15
|
||||
|
||||
Reference in new issue
Block a user