mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
69
Commits
php-7.3.6
...
php-7.2.20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b8cd4bd96 | ||
|
|
7fabfb1a9a | ||
|
|
e8b41bb7e4 | ||
|
|
76b2e5d16d | ||
|
|
c12dc24699 | ||
|
|
e3ee3135fd | ||
|
|
a28383c927 | ||
|
|
d51108d5df | ||
|
|
9fbab56896 | ||
|
|
ad262c9c99 | ||
|
|
a05fed038b | ||
|
|
99dde02e11 | ||
|
|
6c225a6318 | ||
|
|
42c7d5106b | ||
|
|
f6c93431b3 | ||
|
|
940c43019c | ||
|
|
8f7fa350a7 | ||
|
|
8d5f8e13af | ||
|
|
f3ff72e54b | ||
|
|
199eb2b110 | ||
|
|
65ada39360 | ||
|
|
10b208f28d | ||
|
|
d7c7522be9 | ||
|
|
83cdb89f8a | ||
|
|
7d1aa7534d | ||
|
|
2df32942d3 | ||
|
|
f4474e5724 | ||
|
|
a3e6b50442 | ||
|
|
2d3bc71e89 | ||
|
|
ac60007bec | ||
|
|
2e02579474 | ||
|
|
59b0b38d3c | ||
|
|
ee153deb1f | ||
|
|
b01d9fdab1 | ||
|
|
d293f6dcff | ||
|
|
8b53c7232e | ||
|
|
dc586bff36 | ||
|
|
5d67271db0 | ||
|
|
3051147019 | ||
|
|
7821cc3b9f | ||
|
|
59dfaa3f99 | ||
|
|
d661a75d54 | ||
|
|
5533f2490a | ||
|
|
fbb6a27212 | ||
|
|
c34895e837 | ||
|
|
dc1d99e772 | ||
|
|
73ff4193be | ||
|
|
9bca9ef6cf | ||
|
|
e77c8e45ba | ||
|
|
16e037bd46 | ||
|
|
7cf7148a8f | ||
|
|
ed6dee9a19 | ||
|
|
a0c9d0849a | ||
|
|
8baf3ffde6 | ||
|
|
9a74b23297 | ||
|
|
fa6a4483e6 | ||
|
|
96404eb8e2 | ||
|
|
62fe6ba20c | ||
|
|
3a0de243c3 | ||
|
|
7b42cdf95e | ||
|
|
e6a191de1b | ||
|
|
5f8c22d415 | ||
|
|
202e6936d6 | ||
|
|
a8a019d68a | ||
|
|
64ec9f4dbe | ||
|
|
e246dea9fe | ||
|
|
35353dc49a | ||
|
|
4fa32d67bf | ||
|
|
5c4d125d4c |
No files matched your search
+1
-1
@@ -16,7 +16,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.2.0beta5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta6
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
+10
-23
@@ -3,45 +3,32 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
tab_width = 4
|
||||
|
||||
[*.{c,h,y,awk,w32,bat,mk,frag,cpp}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[{*.{awk,bat,c,cpp,d,h,l,mk,re,skl,w32,y},Makefile*}]
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt,inc}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[*.{dtd,html,inc,php,phpt,rng,wsdl,xml,xsd,xsl}]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,m4,sh}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[*.{ac,m4,sh,yml}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
|
||||
[*.patch]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -1,6 +1,47 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2019, PHP 7.2.19
|
||||
04 Jul 2019, PHP 7.2.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76980 (Interface gets skipped if autoloader throws an exception).
|
||||
(Nikita)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #78025 (segfault when accessing properties of DOMDocumentType).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #77956 (When mysqli.allow_local_infile = Off, use a meaningful
|
||||
error message). (Sjon Hortensius)
|
||||
. Fixed bug #38546 (bindParam incorrect processing of bool types).
|
||||
(camporter)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #78106 (Path resolution fails if opcache disabled during request).
|
||||
(Nikita)
|
||||
. Fixed bug #78185 (File cache no longer works). (Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #78079 (openssl_encrypt_ccm.phpt fails with OpenSSL 1.1.1c).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #78038 (Socket_select fails when resource array contains
|
||||
references). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77135 (Extract with EXTR_SKIP should skip $this).
|
||||
(Craig Duncan, Dmitry)
|
||||
. Fixed bug ##77937 (preg_match failed). (cmb, Anatol)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #76345 (zip.h not found). (Michael Maroszek)
|
||||
|
||||
30 May 2019, PHP 7.2.19
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
|
||||
(CVE-2019-11040) (Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77934 (php-fpm kill -USR2 not working). (Jakub Zelenka)
|
||||
@@ -8,10 +49,20 @@ PHP NEWS
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77943 (imageantialias($image, false); does not work). (cmb)
|
||||
. Fixed bug #77973 (Uninitialized read in gdImageCreateFromXbm).
|
||||
(CVE-2019-11038) (cmb)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode()
|
||||
due to integer overflow). (CVE-2019-11039). (maris dot adam)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #77843 (Use after free with json serializer). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed possible crashes, because of inconsistent PCRE cache and opcache
|
||||
SHM reset. (Alexey Kalinin, Dmitry)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #77944 (Wrong meta pdo_type for bigint on LLP64). (cmb)
|
||||
|
||||
@@ -25,6 +76,9 @@ PHP NEWS
|
||||
. Fixed bug #77024 (SplFileObject::__toString() may return array). (Craig
|
||||
Duncan)
|
||||
|
||||
- SQLite:
|
||||
. Fixed bug #77967 (Bypassing open_basedir restrictions via file uris). (Stas)
|
||||
|
||||
02 May 2019, PHP 7.2.18
|
||||
|
||||
- CLI:
|
||||
|
||||
@@ -179,13 +179,7 @@ TSRM_API uint8_t tsrm_is_main_thread(void);
|
||||
#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])
|
||||
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE;
|
||||
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
|
||||
#if ZEND_DEBUG
|
||||
#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
|
||||
#define TSRMLS_CACHE_RESET()
|
||||
#else
|
||||
#define TSRMLS_CACHE_UPDATE() if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache()
|
||||
#define TSRMLS_CACHE_RESET() TSRMLS_CACHE = NULL
|
||||
#endif
|
||||
#define TSRMLS_CACHE _tsrm_ls_cache
|
||||
|
||||
/* BC only */
|
||||
|
||||
@@ -13,18 +13,22 @@ spl_autoload_register(function ($className) {
|
||||
}
|
||||
});
|
||||
|
||||
new Foo;
|
||||
try {
|
||||
new Foo();
|
||||
} catch (Exception $e) { }
|
||||
|
||||
// We never reach here.
|
||||
var_dump(new Foo());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "Foo"
|
||||
string(3) "Bar"
|
||||
|
||||
Fatal error: Uncaught Exception: Bar in %s:%d
|
||||
Fatal error: During class fetch: Uncaught Exception: Bar in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}('Bar')
|
||||
#1 %s(%d): spl_autoload_call('Bar')
|
||||
#2 [internal function]: {closure}('Foo')
|
||||
#3 %s(%d): spl_autoload_call('Foo')
|
||||
#4 {main}
|
||||
thrown in %s on line %d
|
||||
#4 {main} in %s on line %d
|
||||
+1
-1
@@ -2837,7 +2837,7 @@ ZEND_API int zend_disable_function(char *function_name, size_t function_name_len
|
||||
{
|
||||
zend_internal_function *func;
|
||||
if ((func = zend_hash_str_find_ptr(CG(function_table), function_name, function_name_length))) {
|
||||
func->fn_flags &= ~(ZEND_ACC_VARIADIC | ZEND_ACC_HAS_TYPE_HINTS);
|
||||
func->fn_flags &= ~(ZEND_ACC_VARIADIC | ZEND_ACC_HAS_TYPE_HINTS | ZEND_ACC_HAS_RETURN_TYPE);
|
||||
func->num_args = 0;
|
||||
func->arg_info = NULL;
|
||||
func->handler = ZEND_FN(display_disabled_function);
|
||||
|
||||
+21
-7
@@ -1424,14 +1424,28 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *
|
||||
if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) {
|
||||
return zend_lookup_class_ex(class_name, key, 0);
|
||||
} else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) {
|
||||
if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
|
||||
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
|
||||
zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
|
||||
zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
} else {
|
||||
zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
if (fetch_type & ZEND_FETCH_CLASS_SILENT) {
|
||||
return NULL;
|
||||
}
|
||||
if (EG(exception)) {
|
||||
if (!(fetch_type & ZEND_FETCH_CLASS_EXCEPTION)) {
|
||||
zend_string *exception_str;
|
||||
zval exception_zv;
|
||||
ZVAL_OBJ(&exception_zv, EG(exception));
|
||||
Z_ADDREF(exception_zv);
|
||||
zend_clear_exception();
|
||||
exception_str = zval_get_string(&exception_zv);
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"During class fetch: Uncaught %s", ZSTR_VAL(exception_str));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
|
||||
zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name));
|
||||
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
|
||||
zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name));
|
||||
} else {
|
||||
zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=master
|
||||
)
|
||||
set STABILITY=staging
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
|
||||
rem SDK is cached, deps info is cached as well
|
||||
echo Updating dependencies in %DEPS_DIR%
|
||||
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
|
||||
|
||||
@@ -11,7 +11,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=master
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
|
||||
if not exist "%DEPS_DIR%" (
|
||||
echo "%DEPS_DIR%" doesn't exist
|
||||
exit /b 3
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=20
|
||||
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`
|
||||
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ PHP_FUNCTION(curl_multi_select)
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071c00 /* Available since 7.28.0 */
|
||||
error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) timeout * 1000.0, &numfds);
|
||||
error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) (timeout * 1000.0), &numfds);
|
||||
if (CURLM_OK != error) {
|
||||
SAVE_CURLM_ERROR(mh, error);
|
||||
RETURN_LONG(-1);
|
||||
|
||||
@@ -43,7 +43,7 @@ TLS-SRP => No
|
||||
HTTP2 => Yes
|
||||
GSSAPI => No
|
||||
KERBEROS5 => Yes
|
||||
UNIX_SOCKETS => No
|
||||
UNIX_SOCKETS => %r(Yes|No)%r
|
||||
PSL => No
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
|
||||
Host => %s-pc-win32
|
||||
|
||||
@@ -26,5 +26,5 @@ curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
|
||||
string(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:|Unsupported proxy syntax in)%r %s"
|
||||
int(5)
|
||||
+34
-3
@@ -5310,12 +5310,35 @@ PHP_METHOD(DatePeriod, __wakeup)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_is_magic_property
|
||||
* Common for date_period_read_property() and date_period_write_property() functions
|
||||
*/
|
||||
static int date_period_is_magic_property(zend_string *name)
|
||||
{
|
||||
if (zend_string_equals_literal(name, "recurrences")
|
||||
|| zend_string_equals_literal(name, "include_start_date")
|
||||
|| zend_string_equals_literal(name, "start")
|
||||
|| zend_string_equals_literal(name, "current")
|
||||
|| zend_string_equals_literal(name, "end")
|
||||
|| zend_string_equals_literal(name, "interval")
|
||||
) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_read_property */
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
|
||||
{
|
||||
if (type != BP_VAR_IS && type != BP_VAR_R) {
|
||||
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
|
||||
return &EG(uninitialized_zval);
|
||||
zend_string *name = zval_get_string(member);
|
||||
if (date_period_is_magic_property(name)) {
|
||||
zend_throw_error(NULL, "Retrieval of DatePeriod->%s for modification is unsupported", ZSTR_VAL(name));
|
||||
zend_string_release(name);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
Z_OBJPROP_P(object); /* build properties hash table */
|
||||
@@ -5327,7 +5350,15 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
|
||||
/* {{{ date_period_write_property */
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot)
|
||||
{
|
||||
zend_throw_error(NULL, "Writing to DatePeriod properties is unsupported");
|
||||
zend_string *name = zval_get_string(member);
|
||||
if (date_period_is_magic_property(name)) {
|
||||
zend_throw_error(NULL, "Writing to DatePeriod->%s is unsupported", ZSTR_VAL(name));
|
||||
zend_string_release(name);
|
||||
return;
|
||||
}
|
||||
zend_string_release(name);
|
||||
|
||||
std_object_handlers.write_property(object, member, value, cache_slot);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
DatePeriod: Test read only properties
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$start = new DateTime;
|
||||
$interval = new DateInterval('P1D');
|
||||
$end = new DateTime;
|
||||
$period = new DatePeriod($start, $interval, $end);
|
||||
|
||||
echo "recurrences: ";
|
||||
var_dump($period->recurrences);
|
||||
|
||||
echo "include_start_date: ";
|
||||
var_dump($period->include_start_date);
|
||||
|
||||
echo "start: ";
|
||||
var_dump($period->start == $start);
|
||||
|
||||
echo "current: ";
|
||||
var_dump($period->current);
|
||||
|
||||
echo "end: ";
|
||||
var_dump($period->end == $end);
|
||||
|
||||
echo "interval: ";
|
||||
var_dump($period->interval->format("%R%d"));
|
||||
?>
|
||||
--EXPECT--
|
||||
recurrences: int(1)
|
||||
include_start_date: bool(true)
|
||||
start: bool(true)
|
||||
current: NULL
|
||||
end: bool(true)
|
||||
interval: string(2) "+1"
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
DatePeriod: Test cannot modify read only properties
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$period = new DatePeriod(new DateTime, new DateInterval('P1D'), new DateTime);
|
||||
|
||||
$properties = [
|
||||
"recurrences",
|
||||
"include_start_date",
|
||||
"start",
|
||||
"current",
|
||||
"end",
|
||||
"interval",
|
||||
];
|
||||
|
||||
foreach ($properties as $property) {
|
||||
try {
|
||||
$period->$property = "new";
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$period->$property[] = "extra";
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Writing to DatePeriod->recurrences is unsupported
|
||||
Retrieval of DatePeriod->recurrences for modification is unsupported
|
||||
Writing to DatePeriod->include_start_date is unsupported
|
||||
Retrieval of DatePeriod->include_start_date for modification is unsupported
|
||||
Writing to DatePeriod->start is unsupported
|
||||
Retrieval of DatePeriod->start for modification is unsupported
|
||||
Writing to DatePeriod->current is unsupported
|
||||
Retrieval of DatePeriod->current for modification is unsupported
|
||||
Writing to DatePeriod->end is unsupported
|
||||
Retrieval of DatePeriod->end for modification is unsupported
|
||||
Writing to DatePeriod->interval is unsupported
|
||||
Retrieval of DatePeriod->interval for modification is unsupported
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Test for bug #65672: Broken classes inherited from DatePeriod
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P1D');
|
||||
$period = new class(new DateTime, $interval, new DateTime) extends DatePeriod {
|
||||
public $extra = "stuff";
|
||||
};
|
||||
|
||||
var_dump($period->extra);
|
||||
$period->extra = "modified";
|
||||
var_dump($period->extra);
|
||||
|
||||
# Ensure we can modify properties (retrieve for write)
|
||||
$period->extra = [];
|
||||
$period->extra[] = "array";
|
||||
var_dump($period->extra);
|
||||
|
||||
var_dump(isset($period->dynamic1));
|
||||
$period->dynamic1 = "dynamic";
|
||||
var_dump($period->dynamic1);
|
||||
|
||||
# Ensure we can modify properties (retrieve for write)
|
||||
$period->dynamic2 = [];
|
||||
$period->dynamic2[] = "array";
|
||||
var_dump($period->dynamic2);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "stuff"
|
||||
string(8) "modified"
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(5) "array"
|
||||
}
|
||||
bool(false)
|
||||
string(7) "dynamic"
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(5) "array"
|
||||
}
|
||||
@@ -52,7 +52,7 @@ int dom_documenttype_name_read(dom_object *obj, zval *retval)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
ZVAL_STRING(retval, (char *) (dtdptr->name));
|
||||
ZVAL_STRING(retval, dtdptr->name ? (char *) (dtdptr->name) : "");
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #78025 (segfault when accessing properties of DOMDocumentType)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dom')) die('skip dom extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$htm = "<!DOCTYPE><html></html>";
|
||||
$dom = new DOMDocument;
|
||||
$dom->loadHTML($htm);
|
||||
var_dump($dom->doctype->name);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::loadHTML(): htmlParseDocTypeDecl : no DOCTYPE name ! in Entity, line: 1 in %s on line %d
|
||||
string(0) ""
|
||||
===DONE===
|
||||
@@ -3947,6 +3947,8 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
|
||||
if (c == 0xFF)
|
||||
return FALSE;
|
||||
marker = c;
|
||||
if (pos>=ImageInfo->Thumbnail.size)
|
||||
return FALSE;
|
||||
length = php_jpg_get16(data+pos);
|
||||
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
|
||||
return FALSE;
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #77988 (heap-buffer-overflow on php_jpg_get16)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__."/bug77988.jpg", 'COMMENT', FALSE, TRUE);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
DONE
|
||||
@@ -136,7 +136,11 @@ gdImagePtr gdImageCreateFromXbm(FILE * fd)
|
||||
}
|
||||
h[3] = ch;
|
||||
}
|
||||
sscanf(h, "%x", &b);
|
||||
if (sscanf(h, "%x", &b) != 1) {
|
||||
gd_error("invalid XBM");
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
}
|
||||
for (bit = 1; bit <= max_bit; bit = bit << 1) {
|
||||
gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0);
|
||||
if (x == im->sx) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available");
|
||||
if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
|
||||
$filepath = __DIR__ . '/bug77973.xbm';
|
||||
file_put_contents($filepath, $contents);
|
||||
$im = imagecreatefromxbm($filepath);
|
||||
var_dump($im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromxbm(): invalid XBM in %s on line %d
|
||||
|
||||
Warning: imagecreatefromxbm(): '%s' is not a valid XBM file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/bug77973.xbm');
|
||||
?>
|
||||
+3
-1
@@ -1664,7 +1664,9 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
* we can do at this point. */
|
||||
if (*(p1 + 1) == '=') {
|
||||
++p1;
|
||||
--str_left;
|
||||
if (str_left > 1) {
|
||||
--str_left;
|
||||
}
|
||||
}
|
||||
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('iconv')) die('skip ext/iconv required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$hdr = iconv_mime_decode_headers(file_get_contents(__DIR__ . "/bug78069.data"),2);
|
||||
var_dump(count($hdr));
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
int(1)
|
||||
DONE
|
||||
@@ -1554,11 +1554,17 @@ PHP_FUNCTION(locale_lookup)
|
||||
|
||||
intl_error_reset( NULL );
|
||||
|
||||
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS", &arr, &loc_range, &loc_range_len,
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 63
|
||||
# define BANG "!"
|
||||
#else
|
||||
# define BANG
|
||||
#endif
|
||||
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS" BANG, &arr, &loc_range, &loc_range_len,
|
||||
&boolCanonical, &fallback_loc_str) == FAILURE) {
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#undef BANG
|
||||
|
||||
if(loc_range_len == 0) {
|
||||
if(fallback_loc_str) {
|
||||
|
||||
@@ -3,6 +3,7 @@ IntlBreakIterator::getLocale(): basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
IntlBreakIterator::getLocale(): basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = IntlBreakIterator::createSentenceInstance('pt');
|
||||
|
||||
var_dump($bi->getLocale(0));
|
||||
var_dump($bi->getLocale(1));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(2) "pt"
|
||||
==DONE==
|
||||
@@ -99,9 +99,9 @@ disp_locale=fr : display_language=ukrainien
|
||||
disp_locale=de : display_language=Ukrainisch
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_language=Root
|
||||
disp_locale=fr : display_language=racine
|
||||
disp_locale=de : display_language=[rR]oot
|
||||
disp_locale=en : display_language=(Root|Unknown language)
|
||||
disp_locale=fr : display_language=(racine|langue indéterminée)
|
||||
disp_locale=de : display_language=([rR]oot|Unbekannte Sprache)
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_language=Ukrainian
|
||||
|
||||
@@ -3,6 +3,7 @@ locale_get_display_name() icu >= 53.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 64.0
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_name for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'sl_IT_nedis_KIRTI',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'zh-hakka',
|
||||
'zh-wuu',
|
||||
'i-tay',
|
||||
'sgn-BE-nl',
|
||||
'sgn-CH-de',
|
||||
'sl_IT_rozaj@currency=EUR',
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
|
||||
$scr = str_replace(array('(', ')'), '#', $scr);
|
||||
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='sl_IT_nedis_KIRTI'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
|
||||
-----------------
|
||||
locale='sl_IT_nedis-a-kirti-x-xyz'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
|
||||
-----------------
|
||||
locale='sl_IT_NEDIS_ROJAZ_1901'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-hakka'
|
||||
disp_locale=en : display_name=Chinese( #HAKKA#)?
|
||||
disp_locale=fr : display_name=chinois( #HAKKA#)?
|
||||
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
|
||||
-----------------
|
||||
locale='zh-wuu'
|
||||
disp_locale=en : display_name=Chinese #WUU#
|
||||
disp_locale=fr : display_name=chinois #WUU#
|
||||
disp_locale=de : display_name=Chinesisch #WUU#
|
||||
-----------------
|
||||
locale='i-tay'
|
||||
disp_locale=en : display_name=i-tay
|
||||
disp_locale=fr : display_name=i-tay
|
||||
disp_locale=de : display_name=i-tay
|
||||
-----------------
|
||||
locale='sgn-BE-nl'
|
||||
disp_locale=en : display_name=sgn #Belgium, NL#
|
||||
disp_locale=fr : display_name=sgn #Belgique, NL#
|
||||
disp_locale=de : display_name=sgn #Belgien, NL#
|
||||
-----------------
|
||||
locale='sgn-CH-de'
|
||||
disp_locale=en : display_name=sgn #Switzerland, DE#
|
||||
disp_locale=fr : display_name=sgn #Suisse, DE#
|
||||
disp_locale=de : display_name=sgn #Schweiz, DE#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj@currency=EUR'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
|
||||
-----------------
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_name=
|
||||
disp_locale=fr : display_name=
|
||||
disp_locale=de : display_name=
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_name=Unknown language
|
||||
disp_locale=fr : display_name=langue indéterminée
|
||||
disp_locale=de : display_name=Unbekannte Sprache
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
|
||||
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
|
||||
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_name=hindi
|
||||
disp_locale=fr : display_name=hindi
|
||||
disp_locale=de : display_name=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_name=German
|
||||
disp_locale=fr : display_name=allemand
|
||||
disp_locale=de : display_name=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_name=French
|
||||
disp_locale=fr : display_name=français
|
||||
disp_locale=de : display_name=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_name=Japanese
|
||||
disp_locale=fr : display_name=japonais
|
||||
disp_locale=de : display_name=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_name=Chinese #Traditional#
|
||||
disp_locale=fr : display_name=chinois #traditionnel#
|
||||
disp_locale=de : display_name=Chinesisch #Traditionell#
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_name=Chinese #Simplified#
|
||||
disp_locale=fr : display_name=chinois #simplifié#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht#
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_name=Serbian #Cyrillic#
|
||||
disp_locale=fr : display_name=serbe #cyrillique#
|
||||
disp_locale=de : display_name=Serbisch #Kyrillisch#
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_name=Serbian #Latin#
|
||||
disp_locale=fr : display_name=serbe #latin#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch#
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_name=Chinese #Simplified, China#
|
||||
disp_locale=fr : display_name=chinois #simplifié, Chine#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_name=Serbian #Latin, Serbia#
|
||||
disp_locale=fr : display_name=serbe #latin, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Resian#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
|
||||
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_name=German #Germany#
|
||||
disp_locale=fr : display_name=allemand #Allemagne#
|
||||
disp_locale=de : display_name=Deutsch #Deutschland#
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_name=English #United States#
|
||||
disp_locale=fr : display_name=anglais #États-Unis#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_name=Spanish #Latin America#
|
||||
disp_locale=fr : display_name=espagnol #Amérique latine#
|
||||
disp_locale=de : display_name=Spanisch #Lateinamerika#
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
|
||||
disp_locale=fr : display_name=allemand #Suisse, Usage privé=phonebk#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
|
||||
disp_locale=fr : display_name=azéri #arabe, Usage privé=aze-derbend#
|
||||
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_name=Chinese #MIN#
|
||||
disp_locale=fr : display_name=chinois #MIN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN#
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
|
||||
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
|
||||
disp_locale=fr : display_name=x-whatever #Usage privé=whatever#
|
||||
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
|
||||
disp_locale=fr : display_name=qaa #Qaaa, QM, Usage privé=southern#
|
||||
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_name=Serbian #Latin, QM#
|
||||
disp_locale=fr : display_name=serbe #latin, QM#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
|
||||
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_name=English #United States, attribute=islamcal#
|
||||
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
|
||||
disp_locale=fr : display_name=chinois #Chine, a=myext, Usage privé=private#
|
||||
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_name=English #a=myext, b=another#
|
||||
disp_locale=fr : display_name=anglais #a=myext, b=another#
|
||||
disp_locale=de : display_name=Englisch #a=myext, b=another#
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_name=German #Latin America, DE#
|
||||
disp_locale=fr : display_name=allemand #Amérique latine, DE#
|
||||
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_name=a #Germany#
|
||||
disp_locale=fr : display_name=a #Allemagne#
|
||||
disp_locale=de : display_name=a #Deutschland#
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
|
||||
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
|
||||
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
|
||||
-----------------
|
||||
@@ -83,9 +83,9 @@ include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
uk-ua_CALIFORNIA@currency=;currency=GRN: primary_language='uk'
|
||||
root: primary_language='root'
|
||||
root: primary_language='%S'
|
||||
uk@currency=EURO: primary_language='uk'
|
||||
Hindi: primary_language='hindi'
|
||||
de: primary_language='de'
|
||||
|
||||
@@ -102,7 +102,7 @@ uk-ua_CALIFORNIA@currency=;currency=GRN:
|
||||
language : 'uk' , region : 'UA' , variant0 : 'CALIFORNIA' ,
|
||||
---------------------
|
||||
root:
|
||||
language : 'root' ,
|
||||
%s
|
||||
---------------------
|
||||
uk@currency=EURO:
|
||||
language : 'uk' ,
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
ensure an error is returned when mysqli.allow_local_infile is off
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--INI--
|
||||
mysqli.allow_local_infile=0
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
}
|
||||
if (!$link->query("DROP TABLE IF EXISTS test")) {
|
||||
printf("[002] [%d] %s\n", $link->errno, $link->error);
|
||||
}
|
||||
if (!$link->query("CREATE TABLE test (dump1 INT UNSIGNED NOT NULL PRIMARY KEY) ENGINE=" . $engine)) {
|
||||
printf("[003] [%d] %s\n", $link->errno, $link->error);
|
||||
}
|
||||
if (FALSE == file_put_contents('bug77956.data', "waa? meukee!"))
|
||||
printf("[004] Failed to create CVS file\n");
|
||||
if (!$link->query("SELECT 1 FROM DUAL"))
|
||||
printf("[005] [%d] %s\n", $link->errno, $link->error);
|
||||
if (!$link->query("LOAD DATA LOCAL INFILE 'bug77956.data' INTO TABLE test")) {
|
||||
printf("[006] [%d] %s\n", $link->errno, $link->error);
|
||||
echo "done";
|
||||
} else {
|
||||
echo "bug";
|
||||
}
|
||||
$link->close();
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[clean] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
}
|
||||
if (!$link->query($link, 'DROP TABLE IF EXISTS test')) {
|
||||
printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
$link->close();
|
||||
unlink('bug77956.data');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli::query(): LOAD DATA LOCAL INFILE forbidden in %s on line %d
|
||||
[006] [2000] LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile
|
||||
done
|
||||
@@ -156,6 +156,8 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filenam
|
||||
|
||||
if (!(conn->options->flags & CLIENT_LOCAL_FILES)) {
|
||||
php_error_docref(NULL, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE,
|
||||
"LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile");
|
||||
/* write empty packet to server */
|
||||
ret = net->data->m.send(net, vio, empty_packet, 0, conn->stats, conn->error_info);
|
||||
*is_warning = TRUE;
|
||||
|
||||
@@ -581,7 +581,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
|
||||
zval *parameter = &stmt->param_bind[i].zv;
|
||||
|
||||
ZVAL_DEREF(parameter);
|
||||
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) {
|
||||
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG || current_type == MYSQL_TYPE_TINY)) {
|
||||
/* always copy the var, because we do many conversions */
|
||||
if (Z_TYPE_P(parameter) != IS_LONG &&
|
||||
PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i))
|
||||
@@ -798,6 +798,13 @@ mysqlnd_stmt_execute_store_param_values(MYSQLND_STMT_DATA * stmt, zval * copies,
|
||||
int4store(*p, Z_LVAL_P(data));
|
||||
(*p) += 4;
|
||||
break;
|
||||
case MYSQL_TYPE_TINY:
|
||||
if (Z_TYPE_P(data) == IS_STRING) {
|
||||
goto send_string;
|
||||
}
|
||||
int1store(*p, Z_LVAL_P(data));
|
||||
(*p)++;
|
||||
break;
|
||||
case MYSQL_TYPE_LONG_BLOB:
|
||||
if (stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED) {
|
||||
stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED;
|
||||
|
||||
@@ -2856,8 +2856,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||
tmp = t1;
|
||||
if (t1 & MAY_BE_ARRAY) {
|
||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||
/* SEND_UNPACK may acquire references into the array */
|
||||
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
||||
if (t1 & MAY_BE_ARRAY_OF_ANY) {
|
||||
/* SEND_UNPACK may acquire references into the array */
|
||||
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
||||
}
|
||||
}
|
||||
if (t1 & MAY_BE_OBJECT) {
|
||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||
|
||||
@@ -412,8 +412,8 @@ static zend_string *accel_find_interned_string(zend_string *str)
|
||||
}
|
||||
|
||||
if (!ZCG(counted)) {
|
||||
if (accel_activate_add() == FAILURE) {
|
||||
return str;
|
||||
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
|
||||
return NULL;
|
||||
}
|
||||
ZCG(counted) = 1;
|
||||
}
|
||||
@@ -658,10 +658,9 @@ static void accel_use_shm_interned_strings(void)
|
||||
if (ZCSG(interned_strings_saved_top) == NULL) {
|
||||
accel_copy_permanent_strings(accel_new_interned_string);
|
||||
} else {
|
||||
ZCG(counted) = 1;
|
||||
accel_copy_permanent_strings(accel_replace_string_by_shm_permanent);
|
||||
if (ZCG(counted)) {
|
||||
accel_deactivate_sub();
|
||||
}
|
||||
ZCG(counted) = 0;
|
||||
}
|
||||
accel_interned_strings_save_state();
|
||||
|
||||
@@ -1070,7 +1069,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
|
||||
cwd_len = ZSTR_LEN(cwd_str);
|
||||
if (ZCG(cwd_check)) {
|
||||
ZCG(cwd_check) = 0;
|
||||
if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
|
||||
if (ZCG(accelerator_enabled)) {
|
||||
|
||||
zend_string *str = accel_find_interned_string(cwd_str);
|
||||
if (!str) {
|
||||
@@ -1093,7 +1092,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
|
||||
cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res;
|
||||
cwd = ZCG(cwd_key);
|
||||
memcpy(ZCG(cwd_key), res, cwd_len + 1);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1110,7 +1113,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
|
||||
|
||||
if (ZCG(include_path_check)) {
|
||||
ZCG(include_path_check) = 0;
|
||||
if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
|
||||
if (ZCG(accelerator_enabled)) {
|
||||
|
||||
zend_string *str = accel_find_interned_string(ZCG(include_path));
|
||||
if (!str) {
|
||||
@@ -1132,7 +1135,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
|
||||
include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res;
|
||||
include_path = ZCG(include_path_key);
|
||||
memcpy(ZCG(include_path_key), res, include_path_len + 1);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1193,7 +1200,7 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
|
||||
zend_string *realpath;
|
||||
zend_persistent_script *persistent_script;
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
|
||||
if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -1289,6 +1296,10 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
|
||||
/* Align to 64-byte boundary */
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64);
|
||||
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L);
|
||||
#elif ZEND_MM_ALIGNMENT < 8
|
||||
/* Align to 8-byte boundary */
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8);
|
||||
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
|
||||
#else
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
|
||||
#endif
|
||||
@@ -1757,20 +1768,33 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
int key_length;
|
||||
int from_shared_memory; /* if the script we've got is stored in SHM */
|
||||
|
||||
if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
|
||||
if (!file_handle->filename || !ZCG(accelerator_enabled)) {
|
||||
/* The Accelerator is disabled, act as if without the Accelerator */
|
||||
ZCG(cache_opline) = NULL;
|
||||
ZCG(cache_persistent_script) = NULL;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (file_handle->filename
|
||||
&& ZCG(accel_directives).file_cache
|
||||
&& ZCG(enabled) && accel_startup_ok) {
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
}
|
||||
#endif
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
} else if (file_cache_only) {
|
||||
ZCG(cache_opline) = NULL;
|
||||
ZCG(cache_persistent_script) = NULL;
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
#endif
|
||||
} else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
|
||||
} else if (!ZCG(accelerator_enabled) ||
|
||||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache) {
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
}
|
||||
#endif
|
||||
ZCG(cache_opline) = NULL;
|
||||
ZCG(cache_persistent_script) = NULL;
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
}
|
||||
|
||||
@@ -1797,10 +1821,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
/* try to find cached script by key */
|
||||
key = accel_make_persistent_key(file_handle->filename, strlen(file_handle->filename), &key_length);
|
||||
if (!key) {
|
||||
ZCG(cache_opline) = NULL;
|
||||
ZCG(cache_persistent_script) = NULL;
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
}
|
||||
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
|
||||
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
|
||||
ZCG(cache_opline) = NULL;
|
||||
ZCG(cache_persistent_script) = NULL;
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
}
|
||||
|
||||
@@ -2059,12 +2087,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
|
||||
/* zend_resolve_path() replacement for PHP 5.3 and above */
|
||||
static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
|
||||
{
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
if (
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
!file_cache_only &&
|
||||
#endif
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
|
||||
!ZCSG(restart_in_progress)) {
|
||||
ZCG(accelerator_enabled)) {
|
||||
|
||||
/* check if callback is called from include_once or it's a main request */
|
||||
if ((!EG(current_execute_data) &&
|
||||
@@ -2165,9 +2192,8 @@ static void accel_reset_pcre_cache(void)
|
||||
|
||||
static void accel_activate(void)
|
||||
{
|
||||
zend_bool reset_pcre = 0;
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok) {
|
||||
ZCG(accelerator_enabled) = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2195,6 +2221,7 @@ static void accel_activate(void)
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (file_cache_only) {
|
||||
ZCG(accelerator_enabled) = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -2270,16 +2297,16 @@ static void accel_activate(void)
|
||||
}
|
||||
accel_restart_leave();
|
||||
}
|
||||
} else {
|
||||
reset_pcre = 1;
|
||||
}
|
||||
zend_shared_alloc_unlock();
|
||||
}
|
||||
|
||||
ZCG(accelerator_enabled) = ZCSG(accelerator_enabled);
|
||||
|
||||
SHM_PROTECT();
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
|
||||
if (ZCSG(last_restart_time) != ZCG(last_restart_time)) {
|
||||
if (ZCG(accelerator_enabled) && ZCSG(last_restart_time) != ZCG(last_restart_time)) {
|
||||
/* SHM was reinitialized. */
|
||||
ZCG(last_restart_time) = ZCSG(last_restart_time);
|
||||
|
||||
@@ -2287,8 +2314,10 @@ static void accel_activate(void)
|
||||
realpath_cache_clean();
|
||||
|
||||
accel_reset_pcre_cache();
|
||||
} else if (reset_pcre) {
|
||||
ZCG(pcre_reseted) = 0;
|
||||
} else if (!ZCG(accelerator_enabled) && !ZCG(pcre_reseted)) {
|
||||
accel_reset_pcre_cache();
|
||||
ZCG(pcre_reseted) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2316,10 +2345,6 @@ static void accel_deactivate(void)
|
||||
zend_string_release(ZCG(cwd));
|
||||
ZCG(cwd) = NULL;
|
||||
}
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2)
|
||||
@@ -2361,6 +2386,7 @@ static inline int accel_find_sapi(void)
|
||||
"cli-server",
|
||||
"cgi-fcgi",
|
||||
"fpm-fcgi",
|
||||
"fpmi-fcgi",
|
||||
"isapi",
|
||||
"apache2filter",
|
||||
"apache2handler",
|
||||
|
||||
@@ -196,6 +196,8 @@ typedef struct _zend_accel_globals {
|
||||
int counted; /* the process uses shared memory */
|
||||
zend_bool enabled;
|
||||
zend_bool locked; /* thread obtained exclusive lock */
|
||||
zend_bool accelerator_enabled; /* accelerator enabled for current request */
|
||||
zend_bool pcre_reseted;
|
||||
HashTable bind_hash; /* prototype and zval lookup table */
|
||||
zend_accel_directives accel_directives;
|
||||
zend_string *cwd; /* current working directory or NULL */
|
||||
|
||||
@@ -4,6 +4,7 @@ Bug #66461 (PHP crashes if opcache.interned_strings_buffer=0)
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.log_verbosity_level=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.interned_strings_buffer=0
|
||||
--SKIPIF--
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #71443 (Segfault using built-in webserver with intl using symfony)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_cache=/tmp/
|
||||
opcache.file_cache={TMP}
|
||||
opcache.file_cache_only=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #76275: Assertion failure in file cache when unserializing empty try_catch_a
|
||||
--INI--
|
||||
opcache.enabled=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_cache=/tmp
|
||||
opcache.file_cache={TMP}
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #78106: Path resolution fails if opcache disabled during request
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include __DIR__ . "/php_cli_server.inc";
|
||||
php_cli_server_start(getenv('TEST_PHP_EXTRA_ARGS'));
|
||||
|
||||
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
|
||||
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test2.php" );
|
||||
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
included
|
||||
done
|
||||
included
|
||||
done
|
||||
included
|
||||
done
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
echo "included\n";
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
ini_set('opcache.enable', 0);
|
||||
require_once 'bug78106_include.inc';
|
||||
|
||||
echo "done\n";
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once 'bug78106_include.inc';
|
||||
|
||||
echo "done\n";
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #78185: file cache only no longer works
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.file_cache={PWD}
|
||||
opcache.file_cache_only=1
|
||||
--FILE--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') {
|
||||
$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
|
||||
} else {
|
||||
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
|
||||
}
|
||||
foreach (glob($pattern) as $p) {
|
||||
var_dump($p);
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') {
|
||||
$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
|
||||
} else {
|
||||
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
|
||||
}
|
||||
foreach (glob($pattern) as $p) {
|
||||
unlink($p);
|
||||
$p = dirname($p);
|
||||
while(strlen($p) > strlen(__DIR__)) {
|
||||
rmdir($p);
|
||||
$p = dirname($p);
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s78185.php.bin"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Type inference of SEND_UNPACK with empty array
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$array = [1, 2, 3];
|
||||
$values = [];
|
||||
var_dump(array_push($array, 4, ...$values));
|
||||
var_dump($array);
|
||||
}
|
||||
test();
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
@@ -7,6 +7,7 @@ outputs the correct logging at the highest log_verbosity_level
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_cache_only=0
|
||||
opcache.error_log=
|
||||
opcache.log_verbosity_level=4
|
||||
opcache.huge_code_pages=0
|
||||
--SKIPIF--
|
||||
|
||||
@@ -240,6 +240,7 @@ static ZEND_INI_MH(OnEnable)
|
||||
return FAILURE;
|
||||
} else {
|
||||
*p = 0;
|
||||
ZCG(accelerator_enabled) = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -439,11 +440,11 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
if (
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
|
||||
(ZCG(accelerator_enabled) || file_cache_only)
|
||||
#else
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled))
|
||||
(ZCG(accelerator_enabled))
|
||||
#endif
|
||||
) {
|
||||
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
|
||||
@@ -547,7 +548,7 @@ static int accelerator_get_scripts(zval *return_value)
|
||||
struct timeval exec_time;
|
||||
struct timeval fetch_time;
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
|
||||
if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -609,7 +610,7 @@ static ZEND_FUNCTION(opcache_get_status)
|
||||
array_init(return_value);
|
||||
|
||||
/* Trivia */
|
||||
add_assoc_bool(return_value, "opcache_enabled", ZCG(enabled) && (ZCG(counted) || ZCSG(accelerator_enabled)));
|
||||
add_assoc_bool(return_value, "opcache_enabled", ZCG(accelerator_enabled));
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache) {
|
||||
@@ -768,7 +769,10 @@ static ZEND_FUNCTION(opcache_reset)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* exclusive lock */
|
||||
zend_shared_alloc_lock();
|
||||
zend_accel_schedule_restart(ACCEL_RESTART_USER);
|
||||
zend_shared_alloc_unlock();
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
@@ -807,7 +811,7 @@ static ZEND_FUNCTION(opcache_compile_file)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
|
||||
if (!ZCG(accelerator_enabled)) {
|
||||
zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " seems to be disabled, can't compile file");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -846,7 +850,7 @@ static ZEND_FUNCTION(opcache_is_script_cached)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
|
||||
if (!ZCG(accelerator_enabled)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -6444,7 +6444,10 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
|
||||
return FAILURE;
|
||||
}
|
||||
if (mode->is_single_run_aead && enc) {
|
||||
EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, NULL);
|
||||
if (!EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, NULL)) {
|
||||
php_error_docref(NULL, E_WARNING, "Setting tag length for AEAD cipher failed");
|
||||
return FAILURE;
|
||||
}
|
||||
} else if (!enc && tag && tag_len > 0) {
|
||||
if (!mode->is_aead) {
|
||||
php_error_docref(NULL, E_WARNING, "The tag cannot be used because the cipher method does not support AEAD");
|
||||
|
||||
@@ -24,9 +24,12 @@ foreach ($tests as $idx => $test) {
|
||||
// Empty IV error
|
||||
var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, ''));
|
||||
|
||||
// Test setting different IV length and unlimeted tag
|
||||
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 10), $tag, '', 1024));
|
||||
// Test setting different IV length and tag length
|
||||
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 10), $tag, '', 14));
|
||||
var_dump(strlen($tag));
|
||||
|
||||
// Test setting invalid tag length
|
||||
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 16), $tag, '', 1024));
|
||||
?>
|
||||
--EXPECTF--
|
||||
TEST 0
|
||||
@@ -36,4 +39,7 @@ bool(true)
|
||||
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
|
||||
bool(false)
|
||||
string(8) "p/lvgA=="
|
||||
int(1024)
|
||||
int(14)
|
||||
|
||||
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
|
||||
bool(false)
|
||||
@@ -871,6 +871,7 @@ static int php_openssl_enable_peer_verification(SSL_CTX *ctx, php_stream *stream
|
||||
|
||||
if (cafile || capath) {
|
||||
if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) {
|
||||
ERR_clear_error();
|
||||
if (cafile && !php_openssl_load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -560,6 +560,10 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
||||
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_LONG);
|
||||
#endif /* SIZEOF_LONG */
|
||||
break;
|
||||
case IS_TRUE:
|
||||
case IS_FALSE:
|
||||
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_TINY);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_DOUBLE);
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
--TEST--
|
||||
PDO MySQL Bug #38546 (bindParam incorrect processing of bool types)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
|
||||
require dirname(__FILE__) . '/config.inc';
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require dirname(__FILE__) . '/config.inc';
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
|
||||
|
||||
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
||||
|
||||
// To test error cases.
|
||||
$db->exec("SET sql_mode='STRICT_TRANS_TABLES'");
|
||||
|
||||
$db->exec("DROP TABLE IF EXISTS test");
|
||||
|
||||
$query = "CREATE TABLE test(
|
||||
uid MEDIUMINT UNSIGNED NOT NULL,
|
||||
some_bool_1 BOOL NOT NULL,
|
||||
some_bool_2 BOOL NOT NULL,
|
||||
some_int TINYINT NOT NULL
|
||||
)";
|
||||
$db->exec($query);
|
||||
|
||||
$st = $db->prepare("INSERT INTO test (uid, some_bool_1, some_bool_2, some_int) VALUES (?, ?, ?, ?)");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => false,
|
||||
'some_bool_2' => true,
|
||||
'some_int' => -23
|
||||
];
|
||||
$st->bindParam(1, $values['uid'], PDO::PARAM_INT);
|
||||
$st->bindParam(2, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(4, $values['some_int'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok insert\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => (bool) 1,
|
||||
'some_bool_2' => (bool) 0,
|
||||
'some_int' => 1,
|
||||
];
|
||||
|
||||
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
|
||||
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok prepare 1\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => (bool) 0,
|
||||
'some_bool_2' => (bool) 1,
|
||||
'some_int' => 2,
|
||||
];
|
||||
|
||||
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
|
||||
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok prepare 2\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
// String true and false should fail
|
||||
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => 'true',
|
||||
'some_bool_2' => 'false',
|
||||
'some_int' => 3,
|
||||
];
|
||||
|
||||
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
|
||||
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok prepare 3\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
// Null should not be treated as false
|
||||
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => true,
|
||||
'some_bool_2' => null,
|
||||
'some_int' => 4,
|
||||
];
|
||||
|
||||
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
|
||||
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok prepare 4\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
// Integers converted correctly
|
||||
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
|
||||
|
||||
$values = [
|
||||
'uid' => 6,
|
||||
'some_bool_1' => 256,
|
||||
'some_bool_2' => 0,
|
||||
'some_int' => 5,
|
||||
];
|
||||
|
||||
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
|
||||
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
|
||||
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
|
||||
|
||||
$result = $st->execute();
|
||||
|
||||
if ($result === false) {
|
||||
var_dump($st->errorInfo());
|
||||
} else {
|
||||
print("ok prepare 5\n");
|
||||
}
|
||||
|
||||
foreach ($db->query('SELECT * from test') as $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require dirname(__FILE__) . '/mysql_pdo_test.inc';
|
||||
MySQLPDOTest::dropTestTable();
|
||||
?>
|
||||
--EXPECTF--
|
||||
ok insert
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 0
|
||||
[1] => 0
|
||||
[some_bool_2] => 1
|
||||
[2] => 1
|
||||
[some_int] => -23
|
||||
[3] => -23
|
||||
)
|
||||
ok prepare 1
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 1
|
||||
[1] => 1
|
||||
[some_bool_2] => 0
|
||||
[2] => 0
|
||||
[some_int] => 1
|
||||
[3] => 1
|
||||
)
|
||||
ok prepare 2
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 0
|
||||
[1] => 0
|
||||
[some_bool_2] => 1
|
||||
[2] => 1
|
||||
[some_int] => 2
|
||||
[3] => 2
|
||||
)
|
||||
|
||||
Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'true' for column 'some_bool_1' at row 1 in %s
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(5) "HY000"
|
||||
[1]=>
|
||||
int(1366)
|
||||
[2]=>
|
||||
string(65) "Incorrect integer value: 'true' for column 'some_bool_1' at row 1"
|
||||
}
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 0
|
||||
[1] => 0
|
||||
[some_bool_2] => 1
|
||||
[2] => 1
|
||||
[some_int] => 2
|
||||
[3] => 2
|
||||
)
|
||||
|
||||
Warning: PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'some_bool_2' cannot be null in %s
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(5) "23000"
|
||||
[1]=>
|
||||
int(1048)
|
||||
[2]=>
|
||||
string(35) "Column 'some_bool_2' cannot be null"
|
||||
}
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 0
|
||||
[1] => 0
|
||||
[some_bool_2] => 1
|
||||
[2] => 1
|
||||
[some_int] => 2
|
||||
[3] => 2
|
||||
)
|
||||
ok prepare 5
|
||||
Array
|
||||
(
|
||||
[uid] => 6
|
||||
[0] => 6
|
||||
[some_bool_1] => 1
|
||||
[1] => 1
|
||||
[some_bool_2] => 0
|
||||
[2] => 0
|
||||
[some_int] => 5
|
||||
[3] => 5
|
||||
)
|
||||
@@ -37,8 +37,6 @@ function bug_44707($db) {
|
||||
|
||||
$stmt = $db->prepare('INSERT INTO test(id, mybool) VALUES (?, ?)');
|
||||
$stmt->bindParam(1, $id);
|
||||
// From MySQL 4.1 on boolean and TINYINT don't match! INSERT will fail.
|
||||
// Versions prior to 4.1 have a weak test and will accept this.
|
||||
$stmt->bindParam(2, $mybool, PDO::PARAM_BOOL);
|
||||
var_dump($mybool);
|
||||
|
||||
@@ -78,8 +76,6 @@ Native Prepared Statements
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
@@ -89,4 +85,20 @@ array(1) {
|
||||
string(1) "0"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
["id"]=>
|
||||
string(1) "1"
|
||||
["mybool"]=>
|
||||
string(1) "0"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
["id"]=>
|
||||
string(1) "1"
|
||||
["mybool"]=>
|
||||
string(1) "0"
|
||||
}
|
||||
}
|
||||
done!
|
||||
@@ -7,23 +7,14 @@ Francesco Fullone ff@ideato.it
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
if(!extension_loaded("pcntl")) print "skip - PCNTL extension required";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "*** Test by calling function with pid error ***\n";
|
||||
|
||||
$pid = 10000;
|
||||
posix_kill((2 ** 22) + 1, SIGKILL);
|
||||
|
||||
do {
|
||||
$pid += 1;
|
||||
$result = shell_exec("ps -p " . $pid);
|
||||
} while (strstr($pid, $result));
|
||||
|
||||
posix_kill($pid, SIGKILL);
|
||||
var_dump(posix_errno());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test by calling function with pid error ***
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #69054 (Null dereference in readline_(read|write)_history() without paramete
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip"); ?>
|
||||
--INI--
|
||||
open_basedir=/tmp
|
||||
open_basedir={TMP}
|
||||
--FILE--
|
||||
<?php readline_read_history(); ?>
|
||||
==DONE==
|
||||
|
||||
@@ -6,7 +6,7 @@ Bug #32330 (session_destroy, "Failed to initialize storage module", custom sessi
|
||||
session.use_trans_sid=0
|
||||
session.use_cookies=1
|
||||
session.name=sid
|
||||
session.save_path=/tmp
|
||||
session.save_path={TMP}
|
||||
session.gc_probability=1
|
||||
session.gc_divisor=1
|
||||
session.save_handler=files
|
||||
@@ -69,17 +69,17 @@ $_SESSION['E'] = 'F';
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
open: path = /tmp, name = sid
|
||||
open: path = %s, name = sid
|
||||
read: id = %s
|
||||
gc: maxlifetime = %d
|
||||
write: id = %s, data = A|s:1:"B";
|
||||
close
|
||||
open: path = /tmp, name = sid
|
||||
open: path = %s, name = sid
|
||||
read: id = %s
|
||||
gc: maxlifetime = %d
|
||||
destroy: id = %s
|
||||
close
|
||||
open: path = /tmp, name = sid
|
||||
open: path = %s, name = sid
|
||||
read: id = %s
|
||||
gc: maxlifetime = %d
|
||||
write: id = %s, data = E|s:1:"F";
|
||||
|
||||
@@ -3,7 +3,7 @@ Test session_set_save_handler() function: create_sid
|
||||
--INI--
|
||||
session.save_handler=files
|
||||
session.name=PHPSESSID
|
||||
session.save_path=/tmp
|
||||
session.save_path={TMP}
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
|
||||
+21
-2
@@ -618,7 +618,16 @@ try_again:
|
||||
smart_str_append_smart_str(&soap_headers, &soap_headers_z);
|
||||
|
||||
if (soap_version == SOAP_1_2) {
|
||||
smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8");
|
||||
if (context &&
|
||||
(tmp = php_stream_context_get_option(context, "http", "content_type")) != NULL &&
|
||||
Z_TYPE_P(tmp) == IS_STRING &&
|
||||
Z_STRLEN_P(tmp) > 0
|
||||
) {
|
||||
smart_str_append_const(&soap_headers, "Content-Type: ");
|
||||
smart_str_appendl(&soap_headers, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
|
||||
} else {
|
||||
smart_str_append_const(&soap_headers, "Content-Type: application/soap+xml; charset=utf-8");
|
||||
}
|
||||
if (soapaction) {
|
||||
smart_str_append_const(&soap_headers,"; action=\"");
|
||||
smart_str_appends(&soap_headers, soapaction);
|
||||
@@ -626,7 +635,17 @@ try_again:
|
||||
}
|
||||
smart_str_append_const(&soap_headers,"\r\n");
|
||||
} else {
|
||||
smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=utf-8\r\n");
|
||||
if (context &&
|
||||
(tmp = php_stream_context_get_option(context, "http", "content_type")) != NULL &&
|
||||
Z_TYPE_P(tmp) == IS_STRING &&
|
||||
Z_STRLEN_P(tmp) > 0
|
||||
) {
|
||||
smart_str_append_const(&soap_headers, "Content-Type: ");
|
||||
smart_str_appendl(&soap_headers, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
|
||||
smart_str_append_const(&soap_headers, "\r\n");
|
||||
} else {
|
||||
smart_str_append_const(&soap_headers, "Content-Type: text/xml; charset=utf-8\r\n");
|
||||
}
|
||||
if (soapaction) {
|
||||
smart_str_append_const(&soap_headers, "SOAPAction: \"");
|
||||
smart_str_appends(&soap_headers, soapaction);
|
||||
|
||||
@@ -8,13 +8,13 @@ soap.wsdl_cache_enabled=0
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$x = new SoapClient('http://slashdot.org');
|
||||
$x = new SoapClient('https://php.net');
|
||||
} catch (SoapFault $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
die('ok');
|
||||
?>
|
||||
--EXPECTF--
|
||||
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://slashdot.org' : %s
|
||||
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://php.net' : %s
|
||||
|
||||
ok
|
||||
@@ -0,0 +1,77 @@
|
||||
--TEST--
|
||||
SOAP customized Content-Type, eg. SwA use case
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
|
||||
if (!file_exists(__DIR__ . "/../../../sapi/cli/tests/php_cli_server.inc")) {
|
||||
echo "skip sapi/cli/tests/php_cli_server.inc required but not found";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include __DIR__ . "/../../../sapi/cli/tests/php_cli_server.inc";
|
||||
|
||||
$args = substr(PHP_OS, 0, 3) == 'WIN' ? "-d extension_dir=" . ini_get("extension_dir") . " -d extension=php_soap.dll" : "";
|
||||
$code = <<<'PHP'
|
||||
/* Receive */
|
||||
$content = trim(file_get_contents("php://input")) . PHP_EOL;
|
||||
PHP;
|
||||
|
||||
php_cli_server_start($code, false, $args);
|
||||
|
||||
$client = new soapclient(NULL, [
|
||||
'location' => 'http://' . PHP_CLI_SERVER_ADDRESS,
|
||||
'uri' => 'misc-uri',
|
||||
'soap_version' => SOAP_1_2,
|
||||
'user_agent' => 'Vincent JARDIN, test headers',
|
||||
'trace' => true, /* record the headers before sending */
|
||||
'stream_context' => stream_context_create([
|
||||
'http' => [
|
||||
'header' => sprintf("MIME-Version: 1.0\r\n"),
|
||||
'content_type' => sprintf("Multipart/Related")
|
||||
],
|
||||
]),
|
||||
]);
|
||||
|
||||
$client->__soapCall("foo", [ 'arg1' => "XXXbar"]);
|
||||
|
||||
$headers = $client->__getLastRequestHeaders();
|
||||
|
||||
if (strpos($headers, 'Multipart/Related; action="misc-uri#foo"') === FALSE)
|
||||
printf("Content-Type NOK %s" . PHP_EOL, $headers);
|
||||
else
|
||||
printf("Content-Type OK" . PHP_EOL);
|
||||
|
||||
/*
|
||||
* In case of an empty content-type, let's fallback to the default content.
|
||||
*/
|
||||
$client2 = new soapclient(NULL, [
|
||||
'location' => 'http://' . PHP_CLI_SERVER_ADDRESS,
|
||||
'uri' => 'misc-uri',
|
||||
'soap_version' => SOAP_1_2,
|
||||
'user_agent' => 'Vincent JARDIN, test headers',
|
||||
'trace' => true, /* record the headers before sending */
|
||||
'stream_context' => stream_context_create([
|
||||
'http' => [
|
||||
'header' => sprintf("MIME-Version: 1.0\r\n"),
|
||||
'content_type' => sprintf("")
|
||||
],
|
||||
]),
|
||||
]);
|
||||
|
||||
$client2->__soapCall("foo", [ 'arg1' => "XXXbar"]);
|
||||
|
||||
$headers = $client2->__getLastRequestHeaders();
|
||||
|
||||
if (strpos($headers, 'Content-Type: application/soap+xml; charset=utf-8; action="misc-uri#foo"') === FALSE)
|
||||
printf("Content-Type Default NOK %s" . PHP_EOL, $headers);
|
||||
else
|
||||
printf("Content-Type Default OK" . PHP_EOL);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
Content-Type OK
|
||||
Content-Type Default OK
|
||||
==DONE==
|
||||
@@ -853,6 +853,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
|
||||
if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(sock_array), element) {
|
||||
ZVAL_DEREF(element);
|
||||
php_sock = (php_socket*) zend_fetch_resource_ex(element, le_socket_name, le_socket);
|
||||
if (!php_sock) continue; /* If element is not a resource, skip it */
|
||||
|
||||
@@ -881,6 +882,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds) /* {{{ */
|
||||
|
||||
array_init(&new_hash);
|
||||
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(sock_array), num_key, key, element) {
|
||||
ZVAL_DEREF(element);
|
||||
php_sock = (php_socket*) zend_fetch_resource_ex(element, le_socket_name, le_socket);
|
||||
if (!php_sock) continue; /* If element is not a resource, skip it */
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ socket_create_pair($domain, SOCK_STREAM, 0, $sockets);
|
||||
|
||||
$write = null;
|
||||
$except = null;
|
||||
$ref =& $sockets[0]; // bug #78038
|
||||
var_dump(socket_select($sockets, $write, $except, 0));
|
||||
--EXPECT--
|
||||
int(0)
|
||||
|
||||
@@ -2071,6 +2071,15 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
|
||||
case SQLITE_ATTACH:
|
||||
{
|
||||
if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
|
||||
if (strncmp(arg3, "file:", 5) == 0) {
|
||||
/* starts with "file:" */
|
||||
if (!arg3[5]) {
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
if (php_check_open_basedir(arg3 + 5)) {
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
}
|
||||
if (php_check_open_basedir(arg3)) {
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ SQLite3::loadExtension with empty extension test
|
||||
Jelle Lampaert
|
||||
#Belgian Testfest 2009
|
||||
--INI--
|
||||
sqlite3.extension_dir=/tmp
|
||||
sqlite3.extension_dir={TMP}
|
||||
--SKIPIF--
|
||||
<?php require_once(__DIR__ . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
|
||||
+28
-42
@@ -1756,10 +1756,10 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("GLOBALS")-1 && !strcmp(ZSTR_VAL(var_name), "GLOBALS")) {
|
||||
if (zend_string_equals_literal(var_name, "GLOBALS")) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -1800,10 +1800,10 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("GLOBALS")-1 && !strcmp(ZSTR_VAL(var_name), "GLOBALS")) {
|
||||
if (zend_string_equals_literal(var_name, "GLOBALS")) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -1837,7 +1837,7 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -1849,7 +1849,7 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t
|
||||
if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
|
||||
orig_var = Z_INDIRECT_P(orig_var);
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("GLOBALS")-1 && !strcmp(ZSTR_VAL(var_name), "GLOBALS")) {
|
||||
if (zend_string_equals_literal(var_name, "GLOBALS")) {
|
||||
continue;
|
||||
}
|
||||
ZVAL_MAKE_REF(entry);
|
||||
@@ -1882,7 +1882,7 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -1894,7 +1894,7 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table
|
||||
if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
|
||||
orig_var = Z_INDIRECT_P(orig_var);
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("GLOBALS")-1 && !strcmp(ZSTR_VAL(var_name), "GLOBALS")) {
|
||||
if (zend_string_equals_literal(var_name, "GLOBALS")) {
|
||||
continue;
|
||||
}
|
||||
ZVAL_DEREF(entry);
|
||||
@@ -1939,7 +1939,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s
|
||||
}
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -1992,7 +1992,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo
|
||||
}
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2047,9 +2047,10 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
|
||||
continue;
|
||||
}
|
||||
}
|
||||
prefix:
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2074,12 +2075,8 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
}
|
||||
continue;
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
goto prefix;
|
||||
}
|
||||
ZVAL_MAKE_REF(entry);
|
||||
Z_ADDREF_P(entry);
|
||||
@@ -2118,9 +2115,10 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
|
||||
continue;
|
||||
}
|
||||
}
|
||||
prefix:
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2146,12 +2144,8 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
}
|
||||
continue;
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
goto prefix;
|
||||
}
|
||||
ZVAL_DEREF(entry);
|
||||
if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry);
|
||||
@@ -2184,7 +2178,7 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_
|
||||
zend_string_release(str);
|
||||
}
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2231,7 +2225,7 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl
|
||||
zend_string_release(str);
|
||||
}
|
||||
if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2269,7 +2263,8 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL_IND(arr, num_key, var_name, entry) {
|
||||
if (var_name) {
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))
|
||||
|| zend_string_equals_literal(var_name, "this")) {
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
zend_string_release(Z_STR(final_name));
|
||||
@@ -2287,7 +2282,7 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2323,7 +2318,8 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL_IND(arr, num_key, var_name, entry) {
|
||||
if (var_name) {
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))
|
||||
|| zend_string_equals_literal(var_name, "this")) {
|
||||
php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1);
|
||||
if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) {
|
||||
zend_string_release(Z_STR(final_name));
|
||||
@@ -2341,7 +2337,7 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (Z_STRLEN(final_name) == sizeof("this")-1 && !strcmp(Z_STRVAL(final_name), "this")) {
|
||||
if (zend_string_equals_literal(Z_STR(final_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
@@ -2370,7 +2366,6 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_
|
||||
|
||||
static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table) /* {{{ */
|
||||
{
|
||||
int exception_thrown = 0;
|
||||
zend_long count = 0;
|
||||
zend_string *var_name;
|
||||
zval *entry, *orig_var;
|
||||
@@ -2382,11 +2377,7 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table)
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
}
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
continue;
|
||||
}
|
||||
orig_var = zend_hash_find(symbol_table, var_name);
|
||||
@@ -2414,7 +2405,6 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table)
|
||||
|
||||
static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /* {{{ */
|
||||
{
|
||||
int exception_thrown = 0;
|
||||
zend_long count = 0;
|
||||
zend_string *var_name;
|
||||
zval *entry, *orig_var;
|
||||
@@ -2426,11 +2416,7 @@ static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /*
|
||||
if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) {
|
||||
continue;
|
||||
}
|
||||
if (ZSTR_LEN(var_name) == sizeof("this")-1 && !strcmp(ZSTR_VAL(var_name), "this")) {
|
||||
if (!exception_thrown) {
|
||||
exception_thrown = 1;
|
||||
zend_throw_error(NULL, "Cannot re-assign $this");
|
||||
}
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
continue;
|
||||
}
|
||||
orig_var = zend_hash_find(symbol_table, var_name);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
/*
|
||||
DO NOT EDIT THIS FILE!
|
||||
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
the information found in the various php7/ext/.../CREDITS and
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
CREDITS file instead
|
||||
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski");
|
||||
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger");
|
||||
CREDIT_LINE("GetText", "Alex Plotnick");
|
||||
CREDIT_LINE("GNU GMP support", "Stanislav Malyshev");
|
||||
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ");
|
||||
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi");
|
||||
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
|
||||
CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky");
|
||||
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
/*
|
||||
DO NOT EDIT THIS FILE!
|
||||
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
the information found in the various php7/ext/.../CREDITS and
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
CREDITS file instead
|
||||
|
||||
*/
|
||||
|
||||
@@ -4513,7 +4513,28 @@ PHP_FUNCTION(setlocale)
|
||||
}
|
||||
}
|
||||
|
||||
# ifndef PHP_WIN32
|
||||
retval = php_my_setlocale(cat, loc ? ZSTR_VAL(loc) : NULL);
|
||||
# else
|
||||
if (loc) {
|
||||
/* BC: don't try /^[a-z]{2}_[A-Z]{2}($|\..*)/ except for /^u[ks]_U[KS]$/ */
|
||||
char *locp = ZSTR_VAL(loc);
|
||||
if (ZSTR_LEN(loc) >= 5 && locp[2] == '_'
|
||||
&& locp[0] >= 'a' && locp[0] <= 'z' && locp[1] >= 'a' && locp[1] <= 'z'
|
||||
&& locp[3] >= 'A' && locp[3] <= 'Z' && locp[4] >= 'A' && locp[4] <= 'Z'
|
||||
&& (locp[5] == '\0' || locp[5] == '.')
|
||||
&& !(locp[0] == 'u' && (locp[1] == 'k' || locp[1] == 's')
|
||||
&& locp[3] == 'U' && (locp[4] == 'K' || locp[4] == 'S')
|
||||
&& locp[5] == '\0')
|
||||
) {
|
||||
retval = NULL;
|
||||
} else {
|
||||
retval = php_my_setlocale(cat, ZSTR_VAL(loc));
|
||||
}
|
||||
} else {
|
||||
retval = php_my_setlocale(cat, NULL);
|
||||
}
|
||||
# endif
|
||||
zend_update_current_locale();
|
||||
if (retval) {
|
||||
if (loc) {
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
--TEST--
|
||||
Test extract() with $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Extract
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$options = [
|
||||
'EXTR_OVERWRITE' => EXTR_OVERWRITE,
|
||||
'EXTR_SKIP' => EXTR_SKIP,
|
||||
'EXTR_PREFIX_SAME' => EXTR_PREFIX_SAME,
|
||||
'EXTR_PREFIX_ALL' => EXTR_PREFIX_ALL,
|
||||
'EXTR_PREFIX_INVALID' => EXTR_PREFIX_INVALID,
|
||||
'EXTR_IF_EXISTS' => EXTR_IF_EXISTS,
|
||||
'EXTR_PREFIX_IF_EXISTS' => EXTR_PREFIX_IF_EXISTS,
|
||||
];
|
||||
|
||||
foreach ($options as $name => $flags) {
|
||||
echo "{$name}\n";
|
||||
|
||||
$this->handle($name, $flags);
|
||||
$this->handle("{$name}_REFS", $flags | EXTR_REFS);
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
private function handle(string $name, int $flags): void
|
||||
{
|
||||
$array = ["this" => "value"];
|
||||
|
||||
try {
|
||||
$result = extract($array, $flags, "x");
|
||||
echo " extract() = {$result}\n";
|
||||
|
||||
echo " \$this = " . get_class($this) . "\n";
|
||||
echo " \$v_this = " . (isset($x_this) ? $x_this : "NULL") . "\n";
|
||||
} catch (\Throwable $e) {
|
||||
echo " Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(new Extract)->run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
EXTR_OVERWRITE
|
||||
Exception: Cannot re-assign $this
|
||||
Exception: Cannot re-assign $this
|
||||
|
||||
EXTR_SKIP
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
|
||||
EXTR_PREFIX_SAME
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
|
||||
EXTR_PREFIX_ALL
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
|
||||
EXTR_PREFIX_INVALID
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
extract() = 1
|
||||
$this = Extract
|
||||
$v_this = value
|
||||
|
||||
EXTR_IF_EXISTS
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
|
||||
EXTR_PREFIX_IF_EXISTS
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
extract() = 0
|
||||
$this = Extract
|
||||
$v_this = NULL
|
||||
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
--CREDITS--
|
||||
Dave Kelsey <d_kelsey@uk.ibm.com>
|
||||
--INI--
|
||||
open_basedir=/tmp
|
||||
open_basedir={TMP}
|
||||
--FILE--
|
||||
<?php
|
||||
$a=glob("./*.jpeg");
|
||||
|
||||
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
--CREDITS--
|
||||
Dave Kelsey <d_kelsey@uk.ibm.com>
|
||||
--INI--
|
||||
open_basedir=/tmp
|
||||
open_basedir={TMP}
|
||||
--FILE--
|
||||
<?php
|
||||
$a=glob("./*.jpeg");
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Unix locale names are rejected on Windows, except for some special cases
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') die('skip this test is for Windows platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(setlocale(LC_ALL, 'de_DE'));
|
||||
var_dump(setlocale(LC_ALL, 'de_DE.UTF-8'));
|
||||
// the following are supposed to be accepted
|
||||
var_dump(setlocale(LC_ALL, 'uk_UK'));
|
||||
var_dump(setlocale(LC_ALL, 'uk_US'));
|
||||
var_dump(setlocale(LC_ALL, 'us_UK'));
|
||||
var_dump(setlocale(LC_ALL, 'us_US'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(27) "English_United Kingdom.1252"
|
||||
string(26) "English_United States.1252"
|
||||
string(27) "English_United Kingdom.1252"
|
||||
string(26) "English_United States.1252"
|
||||
===DONE===
|
||||
+2
-1
@@ -118,7 +118,8 @@ if test "$PHP_ZIP" != "no"; then
|
||||
])
|
||||
|
||||
AC_DEFINE(HAVE_ZIP,1,[ ])
|
||||
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared,, $LIBZIP_CFLAGS)
|
||||
PHP_EVAL_INCLINE($LIBZIP_CFLAGS)
|
||||
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared)
|
||||
PHP_SUBST(ZIP_SHARED_LIBADD)
|
||||
else
|
||||
AC_MSG_WARN(========================================================)
|
||||
|
||||
+4
-4
@@ -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 19
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.2.19-dev"
|
||||
#define PHP_VERSION_ID 70219
|
||||
#define PHP_RELEASE_VERSION 20
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "7.2.20"
|
||||
#define PHP_VERSION_ID 70220
|
||||
+3
-1
@@ -820,7 +820,7 @@ HELP;
|
||||
if (substr(PHP_OS, 0, 3) == "WIN") {
|
||||
$pass_options .= " -c " . escapeshellarg($conf_passed);
|
||||
} else {
|
||||
$pass_options .= " -c '$conf_passed'";
|
||||
$pass_options .= " -c '" . realpath($conf_passed) . "'";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1611,6 +1611,8 @@ TEST $file
|
||||
|
||||
settings2params($ini_settings);
|
||||
|
||||
$env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings;
|
||||
|
||||
// Check if test should be skipped.
|
||||
$info = '';
|
||||
$warn = false;
|
||||
|
||||
@@ -227,7 +227,6 @@ EMBED_SAPI_API void php_embed_shutdown(void)
|
||||
sapi_shutdown();
|
||||
#ifdef ZTS
|
||||
tsrm_shutdown();
|
||||
TSRMLS_CACHE_RESET();
|
||||
#endif
|
||||
if (php_embed_module.ini_entries) {
|
||||
free(php_embed_module.ini_entries);
|
||||
|
||||
+17
-17
@@ -237,29 +237,29 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||
zend_op_array *ret;
|
||||
uint32_t line;
|
||||
char *bufptr, *endptr;
|
||||
int size;
|
||||
size_t len;
|
||||
|
||||
/* Copy file contents before calling original compile_file,
|
||||
* as it may invalidate the file handle. */
|
||||
if (zend_stream_fixup(file, &bufptr, &len) == FAILURE) {
|
||||
if (type == ZEND_REQUIRE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file->filename);
|
||||
zend_bailout();
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file->filename);
|
||||
}
|
||||
}
|
||||
|
||||
data.buf = estrndup(bufptr, len);
|
||||
data.len = len;
|
||||
|
||||
ret = PHPDBG_G(compile_file)(file, type);
|
||||
if (ret == NULL) {
|
||||
efree(data.buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (file->type == ZEND_HANDLE_MAPPED) {
|
||||
data.len = file->handle.stream.mmap.len;
|
||||
data.buf = emalloc(data.len + 1);
|
||||
memcpy(data.buf, file->handle.stream.mmap.buf, data.len);
|
||||
} else {
|
||||
if (file->type == ZEND_HANDLE_FILENAME) {
|
||||
zend_stream_open(file->filename, file);
|
||||
}
|
||||
|
||||
size = file->handle.stream.fsizer(file->handle.stream.handle);
|
||||
data.buf = emalloc(size + 1);
|
||||
data.len = file->handle.stream.reader(file->handle.stream.handle, data.buf, size);
|
||||
}
|
||||
|
||||
memset(data.buf + data.len, 0, 1);
|
||||
|
||||
data.buf[data.len] = '\0';
|
||||
data.line[0] = 0;
|
||||
*(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * data.len)) = data;
|
||||
|
||||
|
||||
Reference in new issue
Block a user