Compare commits

..
Author SHA1 Message Date
Anatol Belski f52597c960 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Do not set PR_SET_DUMPABLE by default
  Do not set PR_SET_DUMPABLE by default
2018-03-28 09:09:03 +02:00
Joe Watkins 93def6e3a1 set version for release 2018-03-27 18:09:11 +02:00
Joe Watkins d8cd47aa83 set versions 2018-03-14 05:56:27 +01:00
109 changed files with 2374 additions and 2693 deletions

No files matched your search

+1 -1
View File
@@ -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.5
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.1
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
-12
View File
@@ -16,11 +16,9 @@ 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
@@ -291,16 +289,6 @@ 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
-74
View File
@@ -1,79 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 Jun 2018, PHP 7.1.19
- 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 #76335 ("link(): Bad file descriptor" with non-ASCII path).
(Anatol)
. Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT). (Bob)
24 May 2018, PHP 7.1.18
- 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 for array_replace(_recursive) and array_merge(_recursive).
(carusogabriel)
26 Apr 2018, PHP 7.1.17
- Date:
. Fixed bug #76131 (mismatch arginfo for date_create). (carusogabriel)
- 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)
- mbstring:
. Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
. Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
(chrullrich, cmb)
- phpdbg:
. Fixed bug #76143 (Memory corruption: arbitrary NUL overwrite). (Laruence)
- SPL:
. Fixed bug #76131 (mismatch arginfo for splarray constructor).
(carusogabriel)
- standard:
. Fixed bug #75996 (incorrect url in header for mt_rand). (tatarbj)
29 Mar 2018, PHP 7.1.16
- Core:
-13
View File
@@ -1,13 +0,0 @@
--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)
-1
View File
@@ -2810,7 +2810,6 @@ 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;
}
-3
View File
@@ -2248,9 +2248,6 @@ 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
])
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=19
PHP_RELEASE_VERSION=16
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+2 -6
View File
@@ -6,11 +6,6 @@ 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
@@ -19,4 +14,5 @@ var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
%Astring(3) "0.0"%A
string(3) "0.0"
bc math warning: non-zero scale in exponent
+1 -5
View File
@@ -4,11 +4,7 @@ Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
<?php
if(!extension_loaded("bcmath")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
$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";
}
die('skip Not valid for windows');
}
?>
--FILE--
+6 -9
View File
@@ -6,11 +6,6 @@ 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
@@ -18,7 +13,9 @@ var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
--EXPECTF--
%Astring(5) "1.000"
%Astring(5) "1.000"
===DONE===%A
--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
+1 -5
View File
@@ -4,11 +4,7 @@ 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') {
$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";
}
die('skip Not valid for windows');
}
?>
--FILE--
+2 -2
View File
@@ -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;
+1
View File
@@ -3,6 +3,7 @@ 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
+1 -1
View File
@@ -332,7 +332,7 @@ PHP_FUNCTION(curl_multi_info_read)
RETURN_FALSE;
}
if (zmsgs_in_queue) {
zval_ptr_dtor(zmsgs_in_queue);
zval_dtor(zmsgs_in_queue);
ZVAL_LONG(zmsgs_in_queue, queued_msgs);
}
+2 -3
View File
@@ -30,8 +30,7 @@ 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
%A
Hello World!
Hello World!* Closing connection 0
Ok
Hello World!Ok
%A
+1
View File
@@ -65,3 +65,4 @@ Hello World!Ok for CURLOPT_FILE
%AOk for CURLOPT_INFILE
===DONE===
%A
+6 -12
View File
@@ -13,23 +13,17 @@ function curl_cli_server_start() {
$doc_root = __DIR__;
$router = "responder/get.php";
if (substr(PHP_OS, 0, 3) == 'WIN') {
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => array("pipe", "w"),
);
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => STDERR,
);
if (substr(PHP_OS, 0, 3) == 'WIN') {
$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";
+1405 -1414
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -161,7 +161,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, timezone)
ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
@@ -2021,9 +2021,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;
@@ -2041,7 +2041,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
}
return retval;
}
/* }}} */
@@ -2390,7 +2390,7 @@ 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);
+1 -1
View File
@@ -719,7 +719,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
}
if (sugg) {
zval_ptr_dtor(sugg);
zval_dtor(sugg);
array_init(sugg);
}
+1 -1
View File
@@ -1704,7 +1704,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 = (int) php_strnlen(value, length);
length = MIN(length, strlen(value));
}
/* do not recompute length here */
-20
View File
@@ -1,20 +0,0 @@
--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.
+1
View File
@@ -1392,6 +1392,7 @@ 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;
-25
View File
@@ -1,25 +0,0 @@
--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.

Before

Width:  |  Height:  |  Size: 2.2 KiB

-3
View File
@@ -2658,9 +2658,6 @@ 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;
-20
View File
@@ -1,20 +0,0 @@
--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
-1
View File
@@ -1082,7 +1082,6 @@ PHP_RSHUTDOWN_FUNCTION(imap)
}
}
mail_free_errorlist(&IMAPG(imap_errorstack));
IMAPG(imap_errorstack) = NIL;
}
if (IMAPG(imap_alertstack) != NIL) {
@@ -79,7 +79,6 @@ 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
+12 -21
View File
@@ -9,7 +9,6 @@ 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\
@@ -21,6 +20,7 @@ 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,6 +32,8 @@ 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 \
@@ -51,12 +53,17 @@ 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 \
@@ -66,18 +73,6 @@ 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 \
@@ -88,14 +83,10 @@ if test "$PHP_INTL" != "no"; then
breakiterator/breakiterator_methods.cpp \
breakiterator/rulebasedbreakiterator_methods.cpp \
breakiterator/codepointiterator_internal.cpp \
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
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)
PHP_ADD_BUILD_DIR($ext_builddir/collator)
PHP_ADD_BUILD_DIR($ext_builddir/converter)
PHP_ADD_BUILD_DIR($ext_builddir/common)
+1 -1
View File
@@ -130,7 +130,7 @@ if (PHP_INTL != "no") {
ADD_FLAG("LIBS_INTL", "iculx.lib");
}
ADD_FLAG("CFLAGS_INTL", "/EHsc /D U_USING_ICU_NAMESPACE=1");
ADD_FLAG("CFLAGS_INTL", "/EHsc");
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
} else {
WARNING("intl not enabled; libraries and/or headers not found");
+5 -9
View File
@@ -103,23 +103,19 @@ typedef struct _intl_data {
RETVAL_NEW_STR(u8str); \
}
#define INTL_MAX_LOCALE_LEN (ULOC_FULLNAME_CAPACITY-1)
#define INTL_MAX_LOCALE_LEN 80
#define INTL_CHECK_LOCALE_LEN(locale_len) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
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); \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
"Locale string too long, should be no longer than 80 characters", 0 ); \
RETURN_NULL(); \
}
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
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); \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
"Locale string too long, should be no longer than 80 characters", 0 ); \
return FAILURE; \
}
+2 -2
View File
@@ -22,7 +22,7 @@ function ut_main()
'',
'root',
'uk@currency=EURO',
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
);
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 '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
+2 -2
View File
@@ -23,7 +23,7 @@ function ut_main()
'',
'root',
'uk@currency=EURO',
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
);
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 '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
+2 -2
View File
@@ -23,7 +23,7 @@ function ut_main()
'',
'root',
'uk@currency=EURO',
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
);
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 '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
+2 -2
View File
@@ -22,7 +22,7 @@ function ut_main()
'',
'root',
'uk@currency=EURO',
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
);
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 '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
+1 -2
View File
@@ -1,8 +1,7 @@
--TEST--
numfmt_format() icu >= 56.1 && icu < 61.1
numfmt_format() icu >= 56.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
-130
View File
@@ -1,130 +0,0 @@
--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 zwei­hundert­vier­und­dreißig­tausend­fünf­hundert­sieben­und­sechzig 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'
+1 -10
View File
@@ -24,17 +24,8 @@ $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"
int(1)
string(93) "rbbi_create_instance: unable to create instance from compiled rules: U_ILLEGAL_ARGUMENT_ERROR"
==DONE==
==DONE==
@@ -2,7 +2,6 @@
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
@@ -23,7 +22,7 @@ $rules = <<<RULES
!!safe_reverse;
RULES;
$rbbi = new IntlRuleBasedBreakIterator($rules);
$rbbi->setText('sdfkjsdf88á.... ,;');
$rbbi->setText('sdfkjsdf88á.... ,;');;
$br = $rbbi->getBinaryRules();
@@ -1,57 +0,0 @@
--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==
@@ -25,7 +25,7 @@ $rules = <<<RULES
!!safe_reverse;
RULES;
$rbbi = new IntlRuleBasedBreakIterator($rules);
$rbbi->setText('sdfkjsdf88á.... ,;');
$rbbi->setText('sdfkjsdf88á.... ,;');;
do {
var_dump($rbbi->current(), $rbbi->getRuleStatusVec());
@@ -56,4 +56,4 @@ array(1) {
[0]=>
int(4)
}
==DONE==
==DONE==
+4 -3
View File
@@ -1,8 +1,9 @@
--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'); ?>
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -28,4 +29,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==
@@ -1,40 +0,0 @@
--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==
+1 -5
View File
@@ -1170,11 +1170,7 @@ PHP_FUNCTION(ldap_get_entries)
add_assoc_long(&tmp1, "count", num_attrib);
dn = ldap_get_dn(ldap, ldap_result_entry);
if (dn) {
add_assoc_string(&tmp1, "dn", dn);
} else {
add_assoc_null(&tmp1, "dn");
}
add_assoc_string(&tmp1, "dn", dn);
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
ldap_memfree(dn);
#else
-40
View File
@@ -1,40 +0,0 @@
--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 */
+1 -1
View File
@@ -452,7 +452,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 || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != 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);
-13
View File
@@ -1,13 +0,0 @@
--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"
-5
View File
@@ -928,11 +928,6 @@ 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;
+3 -4
View File
@@ -144,13 +144,12 @@ 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. Using "target-1" instead of
* "i-1" here to check the last non-NOP instruction. */
(target > 0 &&
/*keep NOP to support ZEND_VM_SMART_BRANCH */
(i > 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 + target - 1))) {
zend_is_smart_branch(op_array->opcodes + i - 1))) {
if (i != target) {
op_array->opcodes[target] = op_array->opcodes[i];
ssa->ops[target] = ssa->ops[i];
-29
View File
@@ -1,29 +0,0 @@
--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
-28
View File
@@ -1,28 +0,0 @@
--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"
+6 -12
View File
@@ -7,22 +7,16 @@ function php_cli_server_start($ini = "") {
$php_executable = getenv('TEST_PHP_EXECUTABLE');
$doc_root = __DIR__;
if (substr(PHP_OS, 0, 3) == 'WIN') {
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => array("pipe", "w"),
);
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => STDERR,
);
if (substr(PHP_OS, 0, 3) == 'WIN') {
$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);
}
+23 -29
View File
@@ -96,10 +96,8 @@ 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))
@@ -526,13 +524,14 @@ static void zend_file_cache_serialize_prop_info(zval *zv,
prop = Z_PTR_P(zv);
UNSERIALIZE_PTR(prop);
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
if (!IS_SERIALIZED(prop->ce)) {
if (prop->ce && !IS_SERIALIZED(prop->ce)) {
SERIALIZE_PTR(prop->ce);
}
if (prop->name && !IS_SERIALIZED(prop->name)) {
SERIALIZE_STR(prop->name);
if (prop->doc_comment) {
SERIALIZE_STR(prop->doc_comment);
}
}
if (prop->doc_comment && !IS_SERIALIZED(prop->doc_comment)) {
SERIALIZE_STR(prop->doc_comment);
}
}
}
@@ -549,15 +548,12 @@ static void zend_file_cache_serialize_class_constant(zval *z
c = Z_PTR_P(zv);
UNSERIALIZE_PTR(c);
ZEND_ASSERT(c->ce != NULL);
if (!IS_SERIALIZED(c->ce)) {
zend_file_cache_serialize_zval(&c->value, script, info, buf);
if (c->ce && !IS_SERIALIZED(c->ce)) {
SERIALIZE_PTR(c->ce);
zend_file_cache_serialize_zval(&c->value, script, info, buf);
if (c->doc_comment) {
SERIALIZE_STR(c->doc_comment);
}
}
if (c->doc_comment && !IS_SERIALIZED(c->doc_comment)) {
SERIALIZE_STR(c->doc_comment);
}
}
}
@@ -1146,13 +1142,14 @@ static void zend_file_cache_unserialize_prop_info(zval *zv,
UNSERIALIZE_PTR(Z_PTR_P(zv));
prop = Z_PTR_P(zv);
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
if (!IS_UNSERIALIZED(prop->ce)) {
if (prop->ce && !IS_UNSERIALIZED(prop->ce)) {
UNSERIALIZE_PTR(prop->ce);
}
if (prop->name && !IS_UNSERIALIZED(prop->name)) {
UNSERIALIZE_STR(prop->name);
if (prop->doc_comment) {
UNSERIALIZE_STR(prop->doc_comment);
}
}
if (prop->doc_comment && !IS_UNSERIALIZED(prop->doc_comment)) {
UNSERIALIZE_STR(prop->doc_comment);
}
}
}
@@ -1167,15 +1164,12 @@ static void zend_file_cache_unserialize_class_constant(zval *
UNSERIALIZE_PTR(Z_PTR_P(zv));
c = Z_PTR_P(zv);
ZEND_ASSERT(c->ce != NULL);
if (!IS_UNSERIALIZED(c->ce)) {
zend_file_cache_unserialize_zval(&c->value, script, buf);
if (c->ce && !IS_UNSERIALIZED(c->ce)) {
UNSERIALIZE_PTR(c->ce);
zend_file_cache_unserialize_zval(&c->value, script, buf);
if (c->doc_comment) {
UNSERIALIZE_STR(c->doc_comment);
}
}
if (c->doc_comment && !IS_UNSERIALIZED(c->doc_comment)) {
UNSERIALIZE_STR(c->doc_comment);
}
}
}
+7 -9
View File
@@ -852,15 +852,6 @@ static void zend_accel_persist_class_table(HashTable *class_table)
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length, int for_shm)
{
script->mem = ZCG(mem);
ZEND_ASSERT(((zend_uintptr_t)ZCG(mem) & 0x7) == 0); /* should be 8 byte aligned */
zend_shared_alloc_clear_xlat_table();
zend_accel_store(script, sizeof(zend_persistent_script));
if (key && *key) {
*key = zend_accel_memdup(*key, key_length + 1);
}
script->corrupted = 0;
ZCG(current_persistent_script) = script;
@@ -869,6 +860,13 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
script->corrupted = 1;
}
ZEND_ASSERT(((zend_uintptr_t)ZCG(mem) & 0x7) == 0); /* should be 8 byte aligned */
zend_shared_alloc_clear_xlat_table();
zend_accel_store(script, sizeof(zend_persistent_script));
if (key && *key) {
*key = zend_accel_memdup(*key, key_length + 1);
}
zend_accel_store_string(script->script.filename);
#ifdef __SSE2__
+11 -11
View File
@@ -73,7 +73,7 @@
#ifdef HAVE_OPENSSL_MD2_H
#define OPENSSL_ALGO_MD2 4
#endif
#if PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
#define OPENSSL_ALGO_DSS1 5
#endif
#define OPENSSL_ALGO_SHA224 6
@@ -560,7 +560,7 @@ ZEND_GET_MODULE(openssl)
#endif
/* {{{ OpenSSL compatibility functions and macros */
#if PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
#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
@@ -677,7 +677,7 @@ static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
return M_ASN1_STRING_data(asn1);
}
#if PHP_OPENSSL_API_VERSION < 0x10002
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
static int X509_get_signature_nid(const X509 *x)
{
@@ -1237,7 +1237,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req) /* {{{ */
}
/* }}} */
#if defined(PHP_WIN32) || PHP_OPENSSL_API_VERSION >= 0x10100
#if defined(PHP_WIN32) || (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER))
#define PHP_OPENSSL_RAND_ADD_TIME() ((void) 0)
#else
#define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval()
@@ -1324,7 +1324,7 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo) { /* {{{ */
mdtype = (EVP_MD *) EVP_md2();
break;
#endif
#if PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
case OPENSSL_ALGO_DSS1:
mdtype = (EVP_MD *) EVP_dss1();
break;
@@ -1450,7 +1450,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 PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
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);
@@ -3620,7 +3620,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
RETURN_FALSE;
}
#if PHP_OPENSSL_API_VERSION >= 0x10100
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
/* 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.
@@ -3631,7 +3631,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
/* Retrieve the public key from the CSR */
tpubkey = X509_REQ_get_pubkey(csr);
#if PHP_OPENSSL_API_VERSION >= 0x10100
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
/* We need to free the CSR as it was duplicated */
X509_REQ_free(csr);
#endif
@@ -3785,9 +3785,6 @@ 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) {
@@ -3814,6 +3811,9 @@ 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));
-19
View File
@@ -29,25 +29,6 @@ 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
-22
View File
@@ -1,22 +0,0 @@
--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,9 +79,6 @@ 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)
@@ -89,7 +86,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', [$err_pem_no_start_line]);
expect_openssl_errors('openssl_pkey_export_to_file pem', ['0906D06C']);
// 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']);
@@ -98,7 +95,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', [$err_pem_no_start_line]);
expect_openssl_errors('openssl_pkey_get_public', ['0906D06C']);
// private encrypt with unknown padding
@openssl_private_encrypt("data", $crypted, $private_key_file, 1000);
expect_openssl_errors('openssl_private_encrypt', ['04066076']);
@@ -108,7 +105,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', [$err_pem_no_start_line, '04068076', '04067072']);
expect_openssl_errors('openssl_private_(en|de)crypt padding', ['0906D06C', '04068076', '04067072']);
// X509
echo "X509 errors\n";
@@ -117,7 +114,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', [$err_pem_no_start_line]);
expect_openssl_errors('openssl_x509_export_to_file pem', ['0906D06C']);
// 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']);
@@ -132,7 +129,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', [$err_pem_no_start_line]);
expect_openssl_errors('openssl_csr_get_subjec pem', ['0906D06C']);
// other possible cuases that are difficult to catch:
// - ASN1_STRING_to_UTF8 fails in add_assoc_name_entry
+5 -5
View File
@@ -91,7 +91,7 @@
/* Used for peer verification in windows */
#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 PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength);
#endif
@@ -1128,7 +1128,7 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da
}
/* }}} */
#if PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength)
{
BIGNUM *bn = NULL;
@@ -1197,7 +1197,7 @@ static int set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /* {{{ */
}
/* }}} */
#if defined(HAVE_ECDH) && PHP_OPENSSL_API_VERSION < 0x10100
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *zvcurve;
@@ -1240,13 +1240,13 @@ static int 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) && PHP_OPENSSL_API_VERSION < 0x10100
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
if (set_server_ecdh_curve(stream, ctx) == FAILURE) {
return FAILURE;
}
#endif
#if PHP_OPENSSL_API_VERSION < 0x10100
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb);
#endif
/* We now use tmp_rsa_cb to generate a key of appropriate size whenever necessary */
+1 -6
View File
@@ -7,12 +7,7 @@ PDO_HEADER_FILES= \
$(srcdir)/pdo_sql_parser.c: $(srcdir)/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)
(cd $(top_srcdir); $(RE2C) --no-generation-date -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re)
install-pdo-headers:
@echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
+1 -1
View File
@@ -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 < 0 || ext_len >= 50) {
if (ext_len >= 50) {
return FAILURE;
}
+4 -2
View File
@@ -308,7 +308,8 @@ 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("Access Denied</h1>\n </body>\n</html>", sizeof("Access Denied</h1>\n </body>\n</html>") - 1);
PHPWRITE(entry, entry_len);
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
}
/* }}} */
@@ -332,7 +333,8 @@ 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("Not Found</h1>\n </body>\n</html>", sizeof("Not Found</h1>\n </body>\n</html>") - 1);
PHPWRITE(entry, entry_len);
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 Access Denied</h1>
<h1>403 - File /hi Access Denied</h1>
</body>
</html>
@@ -18,6 +18,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /notfound.php Not Found</h1>
</body>
</html>
@@ -18,6 +18,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /index.php Not Found</h1>
</body>
</html>
+1 -1
View File
@@ -19,6 +19,6 @@ Status: 403 Access Denied
<title>Access Denied</title>
</head>
<body>
<h1>403 - File Access Denied</h1>
<h1>403 - File /hi Access Denied</h1>
</body>
</html>
+1 -1
View File
@@ -16,6 +16,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /notfound.php Not Found</h1>
</body>
</html>
+1 -1
View File
@@ -16,6 +16,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /index.php Not Found</h1>
</body>
</html>
@@ -19,6 +19,6 @@ Status: 403 Access Denied
<title>Access Denied</title>
</head>
<body>
<h1>403 - File Access Denied</h1>
<h1>403 - File /hi Access Denied</h1>
</body>
</html>
@@ -16,6 +16,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /notfound.php Not Found</h1>
</body>
</html>
@@ -16,6 +16,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /index.php Not Found</h1>
</body>
</html>
@@ -19,6 +19,6 @@ Status: 403 Access Denied
<title>Access Denied</title>
</head>
<body>
<h1>403 - File Access Denied</h1>
<h1>403 - File /hi Access Denied</h1>
</body>
</html>
@@ -17,6 +17,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /notfound.php Not Found</h1>
</body>
</html>
@@ -16,6 +16,6 @@ Status: 404 Not Found
<title>File Not Found</title>
</head>
<body>
<h1>404 - File Not Found</h1>
<h1>404 - File /index.php Not Found</h1>
</body>
</html>
+7 -8
View File
@@ -1,11 +1,10 @@
#!/usr/bin/env bash
if [[ "$2" = "" ]] || [[ "$3" = "" ]]; then
echo "Usage: $0 BASE_DIRECTORY DEPTH BITS_PER_CHAR"
echo "Usage: $0 BASE_DIRECTORY DEPTH HASH_BITS"
echo "BASE_DIRECTORY will be created if it doesn't exist"
echo "DEPTH must be an integer number >0"
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
echo "HASH_BITS(session.hash_bits_per_character) should be one of 4, 5, or 6"
exit 1
fi
@@ -19,15 +18,15 @@ fi
directory="$1"
depth="$2"
bitsperchar="$3"
hashbits="$3"
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
if [[ "$bitsperchar" -ge "5" ]]; then
if [[ "$hashbits" -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 [[ "$bitsperchar" -ge "6" ]]; then
if [[ "$hashbits" -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
@@ -57,10 +56,10 @@ if [[ ! -d $directory ]]; then
fi
echo "Creating session path in $directory with a depth of $depth for session.sid_bits_per_character = $bitsperchar"
echo "Creating session path in $directory with a depth of $depth for session.hash_bits_per_character = $hashbits"
for i in $hash_chars; do
newpath="$directory/$i"
mkdir $newpath || exit 1
bash $0 $newpath `expr $depth - 1` $bitsperchar recurse
bash $0 $newpath `expr $depth - 1` $hashbits recurse
done
+11 -9
View File
@@ -1532,7 +1532,6 @@ PHP_METHOD(SoapServer, handle)
xmlCharEncodingHandlerPtr old_encoding;
HashTable *old_class_map, *old_typemap;
int old_features;
zval tmp_soap;
SOAP_SERVER_BEGIN_CODE();
@@ -1696,7 +1695,8 @@ 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 *session_vars, *tmp_soap_p;
zval *tmp_soap;
zval *session_vars;
if (PS(session_status) != php_session_active &&
PS(session_status) != php_session_disabled) {
@@ -1707,15 +1707,16 @@ PHP_METHOD(SoapServer, handle)
session_vars = &PS(http_session_vars);
ZVAL_DEREF(session_vars);
if (Z_TYPE_P(session_vars) == IS_ARRAY &&
(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;
(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;
}
}
#endif
/* If new session or something weird happned */
if (soap_obj == NULL) {
zval tmp_soap;
object_init_ex(&tmp_soap, service->soap_class.ce);
@@ -1768,12 +1769,13 @@ 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 *session_vars = &PS(http_session_vars), *tmp_soap_p;
zval *tmp_soap_pp;
zval *session_vars = &PS(http_session_vars);
ZVAL_DEREF(session_vars);
if (Z_TYPE_P(session_vars) == IS_ARRAY &&
(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;
(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;
} else {
soap_obj = &tmp_soap;
}
+21 -21
View File
@@ -1237,11 +1237,11 @@ PHP_FUNCTION(socket_getsockname)
case AF_INET6:
sin6 = (struct sockaddr_in6 *) sa;
inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN);
zval_ptr_dtor(addr);
zval_dtor(addr);
ZVAL_STRING(addr, addr6);
if (port != NULL) {
zval_ptr_dtor(port);
zval_dtor(port);
ZVAL_LONG(port, htons(sin6->sin6_port));
}
RETURN_TRUE;
@@ -1254,11 +1254,11 @@ PHP_FUNCTION(socket_getsockname)
addr_string = inet_ntoa(sin->sin_addr);
inet_ntoa_lock = 0;
zval_ptr_dtor(addr);
zval_dtor(addr);
ZVAL_STRING(addr, addr_string);
if (port != NULL) {
zval_ptr_dtor(port);
zval_dtor(port);
ZVAL_LONG(port, htons(sin->sin_port));
}
RETURN_TRUE;
@@ -1267,7 +1267,7 @@ PHP_FUNCTION(socket_getsockname)
case AF_UNIX:
s_un = (struct sockaddr_un *) sa;
zval_ptr_dtor(addr);
zval_dtor(addr);
ZVAL_STRING(addr, s_un->sun_path);
RETURN_TRUE;
break;
@@ -1316,11 +1316,11 @@ PHP_FUNCTION(socket_getpeername)
case AF_INET6:
sin6 = (struct sockaddr_in6 *) sa;
inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN);
zval_ptr_dtor(arg2);
zval_dtor(arg2);
ZVAL_STRING(arg2, addr6);
if (arg3 != NULL) {
zval_ptr_dtor(arg3);
zval_dtor(arg3);
ZVAL_LONG(arg3, htons(sin6->sin6_port));
}
@@ -1334,11 +1334,11 @@ PHP_FUNCTION(socket_getpeername)
addr_string = inet_ntoa(sin->sin_addr);
inet_ntoa_lock = 0;
zval_ptr_dtor(arg2);
zval_dtor(arg2);
ZVAL_STRING(arg2, addr_string);
if (arg3 != NULL) {
zval_ptr_dtor(arg3);
zval_dtor(arg3);
ZVAL_LONG(arg3, htons(sin->sin_port));
}
@@ -1348,7 +1348,7 @@ PHP_FUNCTION(socket_getpeername)
case AF_UNIX:
s_un = (struct sockaddr_un *) sa;
zval_ptr_dtor(arg2);
zval_dtor(arg2);
ZVAL_STRING(arg2, s_un->sun_path);
RETURN_TRUE;
break;
@@ -1621,14 +1621,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_ptr_dtor(buf);
zval_dtor(buf);
ZVAL_NULL(buf);
} else {
ZSTR_LEN(recv_buf) = retval;
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
/* Rebuild buffer zval */
zval_ptr_dtor(buf);
zval_dtor(buf);
ZVAL_NEW_STR(buf, recv_buf);
}
@@ -1717,8 +1717,8 @@ PHP_FUNCTION(socket_recvfrom)
ZSTR_LEN(recv_buf) = retval;
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
zval_ptr_dtor(arg2);
zval_ptr_dtor(arg5);
zval_dtor(arg2);
zval_dtor(arg5);
ZVAL_NEW_STR(arg2, recv_buf);
ZVAL_STRING(arg5, s_un.sun_path);
@@ -1744,9 +1744,9 @@ PHP_FUNCTION(socket_recvfrom)
ZSTR_LEN(recv_buf) = retval;
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
zval_ptr_dtor(arg2);
zval_ptr_dtor(arg5);
zval_ptr_dtor(arg6);
zval_dtor(arg2);
zval_dtor(arg5);
zval_dtor(arg6);
address = inet_ntoa(sin.sin_addr);
@@ -1775,9 +1775,9 @@ PHP_FUNCTION(socket_recvfrom)
ZSTR_LEN(recv_buf) = retval;
ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0';
zval_ptr_dtor(arg2);
zval_ptr_dtor(arg5);
zval_ptr_dtor(arg6);
zval_dtor(arg2);
zval_dtor(arg5);
zval_dtor(arg6);
memset(addr6, 0, INET6_ADDRSTRLEN);
inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN);
@@ -2170,7 +2170,7 @@ PHP_FUNCTION(socket_create_pair)
RETURN_FALSE;
}
zval_ptr_dtor(fds_array_zval);
zval_dtor(fds_array_zval);
array_init(fds_array_zval);
php_sock[0]->bsd_socket = fds_array[0];
@@ -11,9 +11,6 @@ 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";
+4 -4
View File
@@ -153,7 +153,7 @@ static zend_always_inline uint32_t *spl_array_get_pos_ptr(HashTable *ht, spl_arr
static void spl_array_object_free_storage(zend_object *object)
{
spl_array_object *intern = spl_array_from_obj(object);
if (intern->ht_iter != (uint32_t) -1) {
zend_hash_iterator_del(intern->ht_iter);
}
@@ -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 (data && Z_TYPE_P(data) == IS_INDIRECT) {
if (Z_TYPE_P(data) == IS_INDIRECT) {
data = Z_INDIRECT_P(data);
}
return data;
@@ -1859,8 +1859,8 @@ outexcept:
/* {{{ arginfo and function table */
ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, 0, 0, 0)
ZEND_ARG_INFO(0, input)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, array)
ZEND_ARG_INFO(0, ar_flags)
ZEND_ARG_INFO(0, iterator_class)
ZEND_END_ARG_INFO()
-16
View File
@@ -1,16 +0,0 @@
--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
+10 -22
View File
@@ -2099,18 +2099,10 @@ PHP_FUNCTION(range)
}
if (zstep) {
if (Z_TYPE_P(zstep) == IS_DOUBLE) {
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)
) {
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);
@@ -2250,10 +2242,6 @@ long_str:
}
lstep = step;
if (step <= 0) {
err = 1;
goto err;
}
Z_TYPE_INFO(tmp) = IS_LONG;
if (low > high) { /* Negative steps */
@@ -2800,7 +2788,7 @@ PHP_FUNCTION(array_unshift)
Z_ARRVAL_P(stack)->nNextFreeElement = new_hash.nNextFreeElement;
Z_ARRVAL_P(stack)->arData = new_hash.arData;
Z_ARRVAL_P(stack)->pDestructor = new_hash.pDestructor;
zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack));
/* Clean up and return the number of elements in the stack */
@@ -3241,7 +3229,7 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
}
/* }}} */
/* {{{ proto array array_merge(array arr1 [, array ...])
/* {{{ proto array array_merge(array arr1, array arr2 [, array ...])
Merges elements from passed arrays into one array */
PHP_FUNCTION(array_merge)
{
@@ -3249,7 +3237,7 @@ PHP_FUNCTION(array_merge)
}
/* }}} */
/* {{{ proto array array_merge_recursive(array arr1 [, array ...])
/* {{{ proto array array_merge_recursive(array arr1, array arr2 [, array ...])
Recursively merges elements from passed arrays into one array */
PHP_FUNCTION(array_merge_recursive)
{
@@ -3257,7 +3245,7 @@ PHP_FUNCTION(array_merge_recursive)
}
/* }}} */
/* {{{ proto array array_replace(array arr1 [, array ...])
/* {{{ proto array array_replace(array arr1, array arr2 [, array ...])
Replaces elements from passed arrays into one array */
PHP_FUNCTION(array_replace)
{
@@ -3265,7 +3253,7 @@ PHP_FUNCTION(array_replace)
}
/* }}} */
/* {{{ proto array array_replace_recursive(array arr1 [, array ...])
/* {{{ proto array array_replace_recursive(array arr1, array arr2 [, array ...])
Recursively replaces elements from passed arrays into one array */
PHP_FUNCTION(array_replace_recursive)
{
@@ -4111,7 +4099,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,
@@ -5360,7 +5348,7 @@ PHP_FUNCTION(array_map)
array_init_size(return_value, maxlen);
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL(arrays[0]), num_key, str_key, zv) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(arrays[0]), num_key, str_key, zv) {
fci.retval = &result;
fci.param_count = 1;
fci.params = &arg;
+5 -5
View File
@@ -393,22 +393,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, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
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, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
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, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
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, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()
@@ -4042,7 +4042,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)
{
+1 -1
View File
@@ -319,7 +319,7 @@ case "$PHP_SAPI" in
none)
for PROG in $PHP_BINARIES; do
case "$PROG" in
cgi|cli|phpdbg)
cgi|cli)
PHP_ENABLE_CHROOT_FUNC=yes
;;
+2 -25
View File
@@ -196,7 +196,6 @@ 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 */
@@ -225,38 +224,16 @@ PHP_FUNCTION(link)
}
#ifndef ZTS
# define _TO_PATH topath
# define _FROM_PATH frompath
ret = CreateHardLinkA(topath, frompath, NULL);
#else
# define _TO_PATH dest_p
# define _FROM_PATH source_p
ret = CreateHardLinkA(dest_p, source_p, NULL);
#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;
}
/* }}} */
+2 -2
View File
@@ -34,7 +34,7 @@
/*
The following php_mt_...() functions are based on a C++ class MTRand by
Richard J. Wagner. For more information see the web page at
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/MersenneTwister.h
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
Mersenne Twister random number generator -- a C++ class MTRand
Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
@@ -45,7 +45,7 @@
The period, 2^19937-1, and the order of equidistribution, 623 dimensions,
are far greater. The generator is also fast; it avoids multiplication and
division, and it benefits from caches and pipelines. For more information
see the inventors' web page at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html
Reference
M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
+5 -13
View File
@@ -27,8 +27,6 @@ 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" );
@@ -80,17 +78,14 @@ 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(): Invalid range string - must be numeric in %s on line %d
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
bool(false)
Warning: range(): step exceeds the specified range in %s on line %d
@@ -99,9 +94,6 @@ 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(): Invalid range string - must be numeric in %s on line %d
Warning: range(): step exceeds the specified range in %s on line %d
bool(false)
Done
@@ -1,52 +0,0 @@
--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)
+1 -1
View File
@@ -64,7 +64,7 @@ string(1) "?"
string(1) ","
string(1) " "
++++++++++++++++++++++
string(%d) "Czech_Czech%s.1250"
string(25) "Czech_Czech Republic.1250"
string(1) ","
string(1) " "
string(3) "CZK"
+3 -3
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 1
#define PHP_RELEASE_VERSION 19
#define PHP_RELEASE_VERSION 16
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.1.19"
#define PHP_VERSION_ID 70119
#define PHP_VERSION "7.1.16"
#define PHP_VERSION_ID 70116
-4
View File
@@ -1905,10 +1905,6 @@ 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.
-4
View File
@@ -1905,10 +1905,6 @@ 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.
+2 -6
View File
@@ -841,9 +841,7 @@ HELP;
junit_save_xml();
if (getenv('REPORT_EXIT_STATUS') !== '0' &&
getenv('REPORT_EXIT_STATUS') !== 'no' &&
($sum_results['FAILED'] || $sum_results['BORKED'])) {
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['BORKED'])) {
exit(1);
}
@@ -979,9 +977,7 @@ save_or_mail_results();
junit_save_xml();
if (getenv('REPORT_EXIT_STATUS') !== '0' &&
getenv('REPORT_EXIT_STATUS') !== 'no' &&
($sum_results['FAILED'] || $sum_results['BORKED'])) {
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['BORKED'])) {
exit(1);
}
exit(0);
+2 -4
View File
@@ -2044,11 +2044,9 @@ 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);
}
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
fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1;
if (fd < 0) {
return php_cli_server_send_error_page(server, client, 404);
}
+6 -12
View File
@@ -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 . ' ?>');
}
if (substr(PHP_OS, 0, 3) == 'WIN') {
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => array("pipe", "w"),
);
$descriptorspec = array(
0 => STDIN,
1 => STDOUT,
2 => STDERR,
);
if (substr(PHP_OS, 0, 3) == 'WIN') {
$cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
if (!is_null($router)) {
$cmd .= " {$router}";
@@ -25,12 +25,6 @@ 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}";
+3 -8
View File
@@ -630,16 +630,11 @@ if test "$PHP_FPM" != "no"; then
if test "$PHP_FPM_ACL" != "no" ; then
AC_CHECK_HEADERS([sys/acl.h])
dnl *BSD has acl_* built into libc
AC_CHECK_FUNC(acl_free, [
AC_CHECK_LIB(acl, acl_free, [
PHP_ADD_LIBRARY(acl)
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
],[
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)
])
AC_MSG_ERROR(libacl required not found)
])
fi
+25 -68
View File
@@ -44,10 +44,6 @@ enum { FPM_GET_USE_SOCKET = 1, FPM_STORE_SOCKET = 2, FPM_STORE_USE_SOCKET = 3 };
static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
{
unsigned i;
unsigned socket_set_count = 0;
unsigned socket_set[FPM_ENV_SOCKET_SET_MAX];
unsigned socket_set_buf = 0;
char envname[32];
char *env_value = 0;
int p = 0;
struct listening_socket_s *ls = sockets_list.data;
@@ -58,20 +54,8 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
} else { /* on PARENT EXEC we want socket fds to be inherited through environment variable */
char fd[32];
sprintf(fd, "%d", ls->sock);
socket_set_buf = (i % FPM_ENV_SOCKET_SET_SIZE == 0 && i) ? 1 : 0;
env_value = realloc(env_value, p + (p ? 1 : 0) + strlen(ls->key) + 1 + strlen(fd) + socket_set_buf + 1);
if (i % FPM_ENV_SOCKET_SET_SIZE == 0) {
socket_set[socket_set_count] = p + socket_set_buf;
socket_set_count++;
if (i) {
*(env_value + p + 1) = 0;
}
}
p += sprintf(env_value + p + socket_set_buf, "%s%s=%s", (p && !socket_set_buf) ? "," : "", ls->key, fd);
p += socket_set_buf;
env_value = realloc(env_value, p + (p ? 1 : 0) + strlen(ls->key) + 1 + strlen(fd) + 1);
p += sprintf(env_value + p, "%s%s=%s", p ? "," : "", ls->key, fd);
}
if (which == FPM_CLEANUP_PARENT_EXIT_MAIN) {
@@ -83,14 +67,7 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
}
if (env_value) {
for (i = 0; i < socket_set_count; i++) {
if (!i) {
strcpy(envname, "FPM_SOCKETS");
} else {
sprintf(envname, "FPM_SOCKETS_%d", i);
}
setenv(envname, env_value + socket_set[i], 1);
}
setenv("FPM_SOCKETS", env_value, 1);
free(env_value);
}
@@ -347,9 +324,7 @@ int fpm_sockets_init_main() /* {{{ */
{
unsigned i, lq_len;
struct fpm_worker_pool_s *wp;
char sockname[32];
char sockpath[256];
char *inherited;
char *inherited = getenv("FPM_SOCKETS");
struct listening_socket_s *ls;
if (0 == fpm_array_init(&sockets_list, sizeof(struct listening_socket_s), 10)) {
@@ -357,46 +332,28 @@ int fpm_sockets_init_main() /* {{{ */
}
/* import inherited sockets */
for (i = 0; i < FPM_ENV_SOCKET_SET_MAX; i++) {
if (!i) {
strcpy(sockname, "FPM_SOCKETS");
while (inherited && *inherited) {
char *comma = strchr(inherited, ',');
int type, fd_no;
char *eq;
if (comma) {
*comma = '\0';
}
eq = strchr(inherited, '=');
if (eq) {
*eq = '\0';
fd_no = atoi(eq + 1);
type = fpm_sockets_domain_from_address(inherited);
zlog(ZLOG_NOTICE, "using inherited socket fd=%d, \"%s\"", fd_no, inherited);
fpm_sockets_hash_op(fd_no, 0, inherited, type, FPM_STORE_SOCKET);
}
if (comma) {
inherited = comma + 1;
} else {
sprintf(sockname, "FPM_SOCKETS_%d", i);
}
inherited = getenv(sockname);
if (!inherited) {
break;
}
while (inherited && *inherited) {
char *comma = strchr(inherited, ',');
int type, fd_no;
char *eq;
if (comma) {
*comma = '\0';
}
eq = strchr(inherited, '=');
if (eq) {
int sockpath_len = eq - inherited;
if (sockpath_len > 255) {
/* this should never happen as UDS limit is lower */
sockpath_len = 255;
}
memcpy(sockpath, inherited, sockpath_len);
sockpath[sockpath_len] = '\0';
fd_no = atoi(eq + 1);
type = fpm_sockets_domain_from_address(sockpath);
zlog(ZLOG_NOTICE, "using inherited socket fd=%d, \"%s\"", fd_no, sockpath);
fpm_sockets_hash_op(fd_no, 0, sockpath, type, FPM_STORE_SOCKET);
}
if (comma) {
inherited = comma + 1;
} else {
inherited = 0;
}
inherited = 0;
}
}
Loaded 100 of 109 files, more files were not shown because too many files have changed in this diff. Show more